0

hello I'm new and I Don't Under stand This error ps: it's java

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 18 out of bounds for length 17 at Program.main(Program.java:11)

20th May 2022, 8:08 PM
Dylanbosss3
Dylanbosss3 - avatar
3 odpowiedzi
+ 1
You are accesing index value at 18 but your Array length is 17 only.. Accesing beyond length..
20th May 2022, 8:15 PM
Jayakrishna 🇮🇳
+ 1
I made the change but it gives me this Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 17 out of bounds for length 17 at Program.main(Program.java:11)
20th May 2022, 8:20 PM
Dylanbosss3
Dylanbosss3 - avatar
+ 1
For length 17, maximum valid index is 17-1 =16 only. Because index starts from 0.
20th May 2022, 8:30 PM
Jayakrishna 🇮🇳