0
Multidimensional array
how to find the value couldn't understand the topic plz explain
2 odpowiedzi
+ 1
A Multidimensional Array is an array containing other arrays. The simplest kind is the two dimensional array, it is an array containing arrays which do not contain other arrays.
int [][] multi = new int [][]{ {3, 4, 5}, {6,7,8} };
If you want to access the array, you just have to use the indexes as in normal arrays.
Let's say we want to access the 4:
multi [0][1]
The first brackets stand for the index of the first array which contains number 4. The second brackets stand for the index of four, you handle it like in a normal array. First you access the array itself, then it's components.