Search code examples
javahibernateexceptionindexoutofboundsexception

ArrayIndexOutOfBoundsException in Java and Hibernate


I am using Hibernate and got the exception ArrayIndexOutOfBoundsException. What are the possible causes?


Solution

  • You have tried to access an index which is out of your array size i.e. index < 0 or index >= array.length.

    For example int[] myArray = new int[10]; if you access myArray[11] you will get ArrayIndexOutOfBoundsException