February 2014
Beginner
1248 pages
62h 25m
English
A multidimensional array with the same number of columns in every row can be created with an array-creation expression. For example, the following line declares array b and assign it a reference to a three-by-four array:
int[][] b = new int[3][4];
In this case, we use the literal values 3 and 4 to specify the number of rows and number of columns, respectively, but this is not required. Programs can also use variables to specify array dimensions, because new creates arrays at execution time—not at compile time. The elements of a multidimensional array are initialized when the array object is created.
A multidimensional array in which each row has a ...
Read now
Unlock full access