0
Beginer Help
String array[ ][ ] = { {"Hey", "John", "Bye"}, {"John", "Johnson", "Hello"} }; System.out.println(array[1][1]); Why would the output be Jhonson and not Jhon? I don't understand Multidimensional Arrays.
3 Respostas
+ 1
array[0][0]="Hey"
array[0][1]="John"
array[0][2]="Bye"
array[1][0]="John"
array[1][1]="Johnson"
array[1][2]="Hello"
+ 1
In programming 0 is the first index of an array so in Samsil Arefeen example you can see with [1][1] that the left side chooses the 2nd group of elements in the array and the right side selects the 2nd element of that group.