I've been trying to understand what's happening with the output, when I'm trying to print an empty 2d char array.
import java.util.Arrays;
class Scratch {
public static void main(String[] args) {
char[] tictactoe = new char[9];
tictactoe[0] = '1';
System.out.println(tictactoe);
int[][] new2 = new int[2][2];
new2[0][0] = 2;
System.out.println(new2[0][0]);
char[][] ne3 = new char[3][3];
System.out.println(ne3);
System.out.print(Arrays.deepToString(ne3));
}
}
This is the output I get:
100000000
2
[[C@9807454 // what does this mean? where does it come from?
[[ , , ], [ , , ], [ , , ]]
What I don't understand is, what is being printed if I try to output a 2d char array, which cells has not been initialised? I am specifically referring to code System.out.println(ne3);
which gives me following output line [[C@9807454
Can anyone kindly explain? Thanks so much in advance!