I've seen it stated many times that Java does not support 2-D arrays, but does support an array of arrays. This seems like semantics to me and pages like this just confuse the issue.
I'm sure from a CS perspective there is some subtle and highly technical difference between a 2-D array and an array of arrays. Can someone please explain it? A google search just leads to pages like the one above which only muddies the water even more.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
In a 2D array the size of the second dimension is fixed i.e. every column will be the same length and every row will be the same length.
In an array of arrays, the length of the enclosed arrays can vary.
So arrays of arrays gives you more flexibility - you can model a 2D array by making all the enclosed arrays the same length, but you also have the option of the enclosed arrays being of different lengths.
An array of arrays lets you have different size...what is sometimes called a 'ragged array'.
My personal analogy has to do with eggs. You want an array that ultimately holds eggs. a 1-d array may be an egg carton. It has some 'spots' where you can stick an egg (or a spot can be empty). Forget for now that most egg cartons are really 6x2, let's just pretend it is a long line of spots...
a real 2-d array (i.e. a non-java array) would be a tray of 12x12 spots where you can put an egg. you can refer to the egg in position (3,7). You could have a 3-d array of eggs if you stacked those on top of each other.
Java is more like the real world. You put eggs into egg cartons (a 1-D array). Then, you can have a crate that holds egg cartons. The crate can hold cartons of 12, 6, 8, or 18 eggs...but a crate can only hold cartons. You don't put eggs directly in the crate. The crate is like a java array-of-arrays. It is a container of containers.
Then you may have a shipping palate. It can hold many crates. so it is a container of containers of containers
Then you have a truck. It can hold many palates, so it is a container of containers (palates) of containers (crates) of containers (egg cartons)...
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors