ok here is an example out of my study guide:
int [ ] [ ] a = { {0, 2, 4, 5, 8},
{10, 1, 3, 6, 9},
{1, 4, 6, 4, 3} };
/*I am really lost when it comes to this, I mean which lot of numbers are stored in the first dimention and which are stored in the second? */
final int ROWS = a.length;
final int COLUMNS = a[0].length;
/*what values are ROWS and COLUMNS assigned?
*/
int x;
for (int i = 0; i < ROWS; i++)
{
x = a [i] [0];
//again I don't get this
for (int j = 0; j < COLUMNS ; j++)
{
if (a [i] [j] > x)
x = a [i] [j];
}
System.out.println( i + "\t" + x);
}
Could someone please explain all this to me bcause I don't undestant it at all.
What would the output of this code be?
and what would be the value of ROWS and COLUMNS be?