πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) Runtime Exception - Null Pointer Exception

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
364
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
85%
Success Rate