
The initial values automati-
cally given to array ele-
ments depend on the data
type of the array and are
discussed in Chapter 8.
REFERENCE POINT
9.1 Declaring and Instantiating Multidimensional Arrays 569
9.1.2 Instantiating Multidimensional Arrays
Just like instantiating single-dimensional arrays, you instantiate a multidi-
mensional array using the new keyword. Here is the syntax for instantiating
a two-dimensional array:
arrayName = new datatype [exp1][exp2];
where exp1 and exp2 are expressions that evaluate to integers and
specify, respectively, the number of rows and the number of columns in
the array.
This statement allocates memory for the array