-3

I'm trying to get this library book sorting program to work. If anyone can look over the code and explain to me why this is messing up, I would really appreciate it. I had this code working a few months ago but upon revisiting it, this error has appeared.

1 Answers1

0

Since Index 0 is out of bounds, your array seems to be empty (length = 0). Thus accessing any element (even at position 0) is invalid.

If this error occurs while you try to fill the array, please note, that arrays have fixed length in java.

Islingre
  • 2,030
  • 6
  • 18