Return Array from Class in Java : The array that returns from method contain undisireable values. I don't know why.
<br/>This is DrvierExam Class:

        public class DriverExam 
    {
    	
    
        private char[] answer ={'B','D','A','A','C','A','B','A','C','D','B','C','D','A','D'
        								,'C','C','B','D','A'};
        	private char[] stuAnswer = new char[20];
        	private int totalCorrect = 0;
        	private int[] missed = new int[20];
        	
    	public DriverExam(char stuAnswer[])
    	{
    		for (int i = 0; i < stuAnswer.length; i++)
    		{
    			this.stuAnswer[i] = stuAnswer[i];
    		}
    	}
    	
    	public int gettotalCorrect()
    	{
    		int k = 0;
    		for (int i = 0; i < stuAnswer.length; i++)
    		{
    			if (stuAnswer[i] == answer[i])
    				totalCorrect++;
    		}
    		return totalCorrect;
    	}
    	
    	public int gettotalIncorrect()
    	{
    		return 20-totalCorrect;
    	}
    	
    	public int[] getMissed()
    	{
    		int k = 0;
    		for (int i = 0; i < stuAnswer.length; i++)
    		{
    			if (stuAnswer[i] != answer[i])
    			{
    				missed[k] = i;
    				k++;
    			}
    		}
    		return missed;
    	}
    }

This is the main program:

    import java.util.Scanner;
    public class Main6 
    {
    	public static void main(String[] args) 
    	{
    		char[] answer = new char[20];
    		int[] missed2;
    		String str;
    		Scanner keyboard = new Scanner(System.in);
    		
    		for (int i = 1; i <= 20; i++)
    		{
    			System.out.println("Enter the answer for question #"+i);
    			str = keyboard.nextLine();
    			
    			while (Character.toUpperCase(str.charAt(0)) != 'A' 
    					&& Character.toUpperCase(str.charAt(0)) != 'B'
    					&& Character.toUpperCase(str.charAt(0)) != 'C'
    					&& Character.toUpperCase(str.charAt(0)) != 'D')
    			{
    				System.out.println("Your input is invalid. Only accept A, B, C, or D");
    				System.out.println("Enter the answer for question #"+i);
    				str = keyboard.nextLine();
    			}
    			
    			answer[i-1] = Character.toUpperCase(str.charAt(0));
    		}
    		
    		DriverExam de = new DriverExam (answer);
    		
    		System.out.print("***FINAL RESULT:");
    		System.out.print("\nTotal correct answers: "+de.gettotalCorrect());
    		System.out.print("\nTotal incorrect answers: "+de.gettotalIncorrect());
    		System.out.print("\nQuestions missed: ");
    		
    		missed2 = de.getMissed();
    		for (int i = 0; i < missed.length; i++)
    		{
    			System.out.print(i+" ");
    		}
    	}
    }

In DriverExam class I return an array named "missed" to the main program. In main program, I use an array named "missed2" to store the array returned. But when I print the result (I type all the answer with "A"). It's like bellow:<br/>
***FINAL RESULT:<br/>
Total correct answers: 6<br/>
Total incorrect answers: 14<br/>
Questions missed: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 <br/>

The question missed result is strange and incorrect. Please help me fix my code.