//function
void function(int a[5][])
in passing or even declaring a multidimensional array why is it necessary to specify the row while it's ok not to specify the column?
Because when you do this:
String [][] array2D = new String[5][];
You don't create a 2-D array, but an 1-D array that takes as 'elements' arrays. So you can do this:
array2D[0] = new String[2];
array2D[1] = new String[10];
....
and access like:
array2D[0][0];
array2D[0][1];
//array2D[0][2] : this is wrong because the first element of array2D is an array with length 2. So you need to be careful with the for loops
array2D[1][0];
array2D[1][1];
...
array2D[1][9];
something like jagged array
something like jagged array
all there was to be said was already said. maybe it's because it's still early here, but is there a reason why you re-opened this tread?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.