A

Admin • 828.03K Points
Coach

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);
}
  • (A) 0
  • (B) Null
  • (C) Compiler error
  • (D) Runtime Exception - Null Pointer Exception
  • Correct Answer - Option(D)
  • Views: 15
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.