examples of 2. Array index out of bound exceptions in java
Example 1: catch array out of bounds exception java
try {
array[index] = someValue;
}
catch(ArrayIndexOutOfBoundsException exception) {
handleTheExceptionSomehow(exception);
}
Example 2: java array out of bounds
//Use index inside the bounds of the array