Analyze the following code: public class Test { public static void main(String[] args) { int[] x = new int[5]; int i; for (i = 0; i < x.length; i++) x[i] = i; System.out.println(x[i]); } }
A.
The program has a runtime error because the last statement in the main method causes ArrayIndexOutOfBoundsException.
B.
The program displays 4.
C.
The program has a compile error because i is not defined in the last statement in the main method.