Arrays with 2 subscripts are often used to represent tables of values.
To identify a particular element in the table, we specify:
its row (by convention, the 1st subscript), and
its column (by convention, the 2nd subscript). // Draw a picture
Arrays in Java can have more than 2 subscripts.
Can you think of something that might be well represented as an array with 3 subscripts?
In Java, multiple-subscripted arrays are implemented as arrays of arrays:
A 2-dimensional array of int is implemented as an array of an array of int.
There really are only single-subscripted arrays, but an array's elements can be anything, including
arrays.
This simplifies the language.
A good illustration of this uniform treatment is the inner loop of the printArray method: Clearly, element
a[i] is itself an array; it has a length attribute.