O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.3. Multi-dimensional arrays: jagged arrays

Unlike rectangular arrays, jagged arrays are arrays of arrays. [6] In the case of rectangular arrays, we can think of a 2D array as a planar rectangular table, where the first-level array specifies a row, and the second-level array specifies a cell in the row. Notice that the number of cells in each row has to be the same. If row 0 has 10 cells, row 1 will have 10 cells – a rectangular array is always a neat rectangle (hence the name).

[6] Since Java doesn't differentiate between rectangular and jagged arrays, you may have heard your Java instructor telling you that multi-dimensional arrays in Java are arrays of arrays too. But, as you shall see, there's a difference between jagged and rectangular ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required