🎴 Flashcard Mode
Java Programming Fundamentals
Card1 / 15
Mastered0
Review0
QuestionClick to flip
What is the output of the given program?
public class ScopeTest
{
public static void main (String [] args)
{
int[][] xx[][][] = null;
System.out.println(xx);
}
}
AnswerClick to flip back
A
Null
💡 Explanation:
This is the correct choice because an array variable (here xx) can very well have the null value. Null is the reserved constant used in Java to represent a void reference, i.e. a pointer to nothing. Internally, it is just a binary 0, but in the high level Java language, it is a magic constant, quite distinct from zero, that internally could have any representation. So, this answer is correct.