Multiple choice

What is the output of the given program?

public class ScopeTest
{
public static void main (String [] args)
{
int[][] xx[][][] = null;
if(xx)
{
System.out.println(xx);
}
else
{
System.out.println("False");
}
}
}

  1. Null

  2. False

  3. Java.Lang.NullPointerException

  4. 0

  5. Compilation fails

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

This is the correct choice. Line if(xx) contains an error because we can pass only Boolean value to the if() condition, but here null is passed. So, the compiler will raise an error that “cannot be converted to Boolean”. So, this answer is true.