Simple:
The first square brackets it's for ¿Wich array you are looking for? {5, 22, 30, 40, 30}
[0] or {96, 20, 30, 25, 25}
[1] ?
Then, the second square brackets are for: ¿Wich element inside the array are you looking for? To retrieve the 22 of {5, 22, 30, 40, 30}
you sould use [0] [1], [menaing First array] and [second element of array choosen].
Edit
You need 2 for
cicles to iterate all the elements:
for (int row = 0; row < array.length; row++) {
for (int col = 0; col < array[row].length; col++) {
System.Out.Println(array[row][col]);
}
}
Source here
Edit #2
To iterate only for the first array, burn the first square bracket to [0]:
for (int col = 0; col < array[0].length; col++) {
System.Out.Println(array[0][col]); // Iterating only the first array elements.
}