java handle index out of bounds exception code example
Example: catch array out of bounds exception java
try {
array[index] = someValue;
}
catch(ArrayIndexOutOfBoundsException exception) {
handleTheExceptionSomehow(exception);
}
try {
array[index] = someValue;
}
catch(ArrayIndexOutOfBoundsException exception) {
handleTheExceptionSomehow(exception);
}