HELP!
1. Let a be a 2 dimensional array with 2 rows. What expression will give the correct number of elements that a can hold?
a) a.length
b) 2*a.length
c) a[0].length
d) a[1].length
e) a[0].length+a[1].length
2. Describe what will be the content of the 2D array a after the following code fragment is executed:
int r=3; // number of rows
int c=5; // number of columns
int [][] a = new int[r][c]; // create array a
// Compute a multiplication table:
int i, j;
for( i = 0; i < r; i++)
{ for( j = 0; j < c; j++)
{ a[j] = (i+1)*(j+1); // Build multiplication table
}
}
It would be greatly appreciated.
Thanks,
gp

