[Solved] What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?

Your first port of call should be the documentation which explains it reasonably clearly: Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array. So for example: int[] array = new int[5]; int boom = array[10]; … Read more