When we allocate a multi-dimensional array e.g., with
one single array object is created, which directly provides space for all the elements.
A multi-dimensional array is one thing
A multi-dimensional is a structure of nested arrays
CorrectionHere is what's right.
In Java, a multi-dimensional array is simply an array of arrays (of arrays, of arrays, of …). Thus:
int a3 = new int; int a2 = a3; int a1 = a3; int i = a3;
a3 is a three-dimensional array, but, really, it just is an array with 4 elements, each of the elements is of type
int (an array of array of int). So,
a3 is an array which contains 4 references to 4 arrays, which each contains 5 references to 5 arrays, which each contain 6
ints. We assign the value of the 0th element of
a2, which is a two-dimensional array.