Accenture Java Programming Practice Question
class ArrayTest { public static void main(String args[]) { int[] primes = new int[10]; primes[0] = "a"; System.out.println(primes[0]); } } What will be the result of compiling and executing the above code?Answer options
A
Runtime exception
B
a
C
ArrayStoreException
D
compile time error
Correct answer: compile time error
Explanation
Correct answer: compile time error.