Multidimensional Arrays Flashcards
1
Q
How do you instantiate a multidimensional array?
A
int[][] a = new int[2][4];
or, you can leave the last dimensions unallocated, leaving them null, as long as you at least declare the first
int[][] a = new int[2][];
int[][][][][] a = new int[3][5][][][];