Multiple choice

What is the output of the given code?

public class MyFor3
{
public static void main(String[] args)
{
int [] xx = null; System.out.println(xx);
}
}

  1. Null

  2. Java.lang.NullPointerException

  3. Compilation fails

  4. 0

  5. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is correct because an array variable (here xx) can very well have null value. Null is the reserved constant used in Java to represent a void reference.