Java Array Default Initialization
What is the output of the program above?
public class ArrayDefault {
public static void main(String[] args) {
int[] nums = new int[5];
System.out.println(nums[2]);
}
}
A
5
B
ArrayIndexOutOfBoundsException
C
0
D
null
APFIVE