0

¿Alguien puede explicarme porqué resulta "C" como Output?

String[ ] myNames = { "A", "B", "C", "D"}; System.out.println(myNames[2]);

30th Aug 2017, 8:08 PM
BlackTick
BlackTick - avatar
1 Antwort
+ 3
because arrays counting starts at 0 in java so it is 0,1,2,3 MyArray[0] is A MyArray[1] is B and so on...
30th Aug 2017, 8:11 PM
Michael Vigato
Michael Vigato - avatar