Q. What is the output of the below Java code snippet with arrays?
Code:
static int[] nums;
public static void main(String args[])
{
System.out.println(nums.length);
}
β
Correct Answer: (D)
Runtime Exception - Null Pointer Exception