int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}; try { System.out.println(arr[12]); } catch(ArrayIndexOutOfBoundsException exception) { handleTheExceptionSomehow(exception); }
when the index used to address array items exceeds the allowed value,Array index out of bounds error will occur.