//I modified your code may be you modify it further as per your requirement
//Is this the output you want to have???
import java.util.Scanner;
public class ArrayDriverLicense
{
public static void main (
String [] args)
{
Scanner keyboard = new Scanner(System.in);
String input=null;
int sum = 0,i=0,correct=0;
char [] answers = {'B', 'B', 'C', 'B', 'A', 'A', 'A', 'A','B', 'A', 'B', 'A', 'D', 'C', 'D', 'D','B', 'A', 'C', 'A' };
char [] userinput ;
System.out.println("Please enter all your 20 answers using only A TO D without space then press Enter");
Deleted: see this FAQ
System.out.println("You missed " +sum + " questions.");
System.out.println("Correct Answer "+correct);
if(correct==20)
System.out.println("You scored a 100%");
}
catch(ArrayIndexOutOfBoundsException unmatched)
{
System.out.println("no of answer does not match the no of question No Calculation");
}
}
}