- Multidimensional Array - An array of arrays, the elements of which are accessed with multiple
integer indexes (one per dimension).
- All dimensions must be arrays of the same data type.
- All dimensions have arrays that are zero-based.
- Easy to think of in two dimensions (think of a sheet with rows and columns), especially Rectangular Two-Dimensional Arrays.
double[][] temps = new double[3][4]; // 3 rows by 4 columns
- Harder to visualize in three or more dimensions, but a bit easier if you think of multiple
sheets, with each sheet a different "plane", with general recommendation
to think of first dimension as the plane #, followed by row, followed by column.
int[][][] numbers = new int[numPlanes][numRows][numColumns];
- Jagged Arrays - Arrays need not be rectangular, they can be jagged as so:
int[][] jagged = new int[3][];
jagged[0] = new int[2];
jagged[1] = new int[4];
jagged[2] = new int[3];