








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









array. The size of the array is determined by the number of initial values provided in the array initializer
// Creates an array of size 3; elements are initialized to 1, 2, and 3 respectively
What are Multidimensional Arrays
Using the new operator
new Type [ n1] [n2]…[nk]
{ I 1 , I 2 , ...., I k}
double mat1[ ][ ] = new double[4][5];
This creates a 4 x 5 two-dimensional array. All elements are initialized to 0.0.
int mat2[ ] [ ] = {{1, 2, 3}, {4, 5, 6}};
This creates a 2 x 3 two-dimensional array. The elements are initialized as:
mat2[0][0]=1 mat2[1][0]= 4 mat2[0][1]=2 mat2[1][1]= 5 mat2[0][2]=3 mat2[1][2]= 6
Processing Multidimensional
Arrays
Interesting Tidbits about Arrays in
Java