What is a possible output of the following code?
String[] strings = new String[2];
System.out.println(strings);
A. [null, null] B. [,] C. [Ljava.lang.String;@54a12183 D. None of the above
C.
Calling toString()
on an array doesn't output the contents of the array, making Option C correct.
If you wanted Option A to be the answer, you'd have to call Arrays.toString(strings).