catch array out of bounds exception java

‮tth‬ps://www.lautturi.com
catch array out of bounds exception java
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.

Created Time:2017-09-01 05:42:16  Author:lautturi