Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

why im getting this error ?

18th Nov 2022, 3:24 PM
shivam prajapati
shivam prajapati - avatar
2 Respostas
+ 5
It means You are trying to attempt elements of array beyond it's boundary or exceed length.. edit: yes. Empty array accessing..
18th Nov 2022, 3:25 PM
Jayakrishna šŸ‡®šŸ‡³
+ 4
It write exactly the issue. The array is empty (length=0) and you try acess the 1st element(index=0).
18th Nov 2022, 3:36 PM
Giannis
Giannis - avatar