Java syntax: Difference between revisions

Content deleted Content added
Line 870:
 
====Multi-dimensional arrays====
In Java, multi-dimensional arrays are represented as arrays of arrays. Technically, they are represented by arrays of references to other arrays.
 
<source lang=Java5>
Line 879:
</source>
 
Due to the nature of the multi-dimensional arrays, sub-arrays maycan vary in length, so multi-dimensional arrays are not bound to be rectangular unlike C:
<source lang=Java>
int[][] numbers = new int[2][]; //Initialization of the first dimension only