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.2. Multi-dimensional arrays: rectangular arrays

Rectangular arrays are, as the name implies, arrays which look like a table. A 2D rectangular array can be represented as a plane rectangle, and a 3D rectangular array can be represented as a cuboid. [4] Whatever the case, the idea is the same – in rectangular arrays, every row has the same number of columns. Jagged arrays differ from this as you will see later.

[4] Some people have great difficulty understanding 4D arrays and above because it is difficult to picture a 4D rectangular array as represented by a simple object (a 4D shape?) in our 3D world.

The syntax for rectangular arrays is different from Java. Study the statements below and note the syntactical differences.

  • Declaring a 2D 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