0
No comprendí la respuesta,la deduci por ensayo y error
[ 0] [2] la coordenada de ubicación no puede ser 8
2 ответов
+ 1
Translation of your question :
I didn't understand the answer, I deduced it by trial and error [0] [2] the location coordinate does not can be 8
____
So , where is your complete question?
//
Remember array index starts from 0 in java
If you have array of n elements first element will have index 0 and second will have 1 and so on....
Last element will be at index n-1
Index ->I
Element ->E
| I | [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ]
___|____________________
| E | e1 e2 e3 e4 e5
As index starts from 0 whenever you have to access say m'th element use index m-1
Ex. When you want to access 5th element you'll use 5-1 = 4 as index.
Same is used for multidimensional array.
Considering 2d array....
If you want to access element from x'th row and y'th column you'll use [x-1][y-1] as index.
Ex. If you have to access element from 5th row and 3rd column you'll use index [5-1][3-1] that is [4][2]
You can find such logics in the course you have joined (Java) just scroll through comment section .read properly
+ 1
Gracias