To visualize a three-dimensional array, and to comprehend its length, you can think of it in terms of literal physical dimensions (remember the book Flat Land?).

One object:

.

An array of objects:

.............

The length of this array (`array.length`

) is how many elements, or dots, counting from left to right.

A two-dimensional array of objects:

.............
.............
.............
.............
.............
.............

Each element in the previous array now has its own array, going down. The length of the first element in this array (`array[0].length`

, the top-left-most) is counting the dots top to bottom.

A three dimensional array is like a cube (this is all assuming uniform lengths among elements)

.............
............. .
............. . .
............. . . .
............. . . .
............. . . .
. . . . . . . . .
. . . . . . . ..
. . . . . . . .

Each element in the previous array now has *its* own array (going *deep* "into" the screen). The length of the first element in **this** array (`array[0][0].length`

, the top-left-most element) is the number of dots deep.

Not once have I (directly) used a three dimensional array.

### Like this:

Like Loading...

*Related*