I have a code that crashes and gives the following message: java.lang.IndexOutOfBoundsException: Index: -1, Size: 9
What does Index -1 mean?
I have a code that crashes and gives the following message: java.lang.IndexOutOfBoundsException: Index: -1, Size: 9
What does Index -1 mean?
Somewhere in your code, your index variable is getting a negative value. Could you please provide some code?
It means that the array/ list etc you are using have total size of 9 items. But you are trying to get a record/item with index "-1". Because in most languages, array/list indexes start from "0" to "size - 1", so you can't use index either smaller than 0, or greater than size of array/list