+ 2

I DON'T UNDERSTAND HOW THE OUTPUT OF QUESTION 1 ON MULTIDIMENSIONAL ARRAYS == JOHNSON

someone please exaplain how the answer Is Johnson Im completely lost in this lesson on arrays

26th Jan 2017, 6:37 PM
Nathaniel Ruffer
Nathaniel Ruffer - avatar
4 Respostas
+ 4
What is the output of this code? String array[ ][ ] = { {"Hey", "John", "Bye"}, {"John", "Johnson", "Hello"} }; System.out.println(array[1][1]); You can choose to read it one by one. E.g.: you can first find out what's array[1]. This would give the output of {"John", "Johnson", "Hello"}. Then after that, find out what is array[1][1] which is basically array[1] of {"John", "Johnson", "Hello"} which is Johnson. *** position of array starts from 0. hence array[1] simply means second position in the array. :)
27th Jan 2017, 2:03 AM
lowshuen
0
okay thanks alot
30th Jan 2017, 5:06 PM
Nathaniel Ruffer
Nathaniel Ruffer - avatar
0
johnson
16th Jul 2017, 4:28 PM
Srijit Acharyay
Srijit Acharyay - avatar
0
Johnson
7th May 2022, 11:07 AM
U.L.F. Feroza