index out of bound exception in java code example
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
Example 3: array index out of bound exception in java
for (int i=0;i>array.length-1;i++){
System.out.println(array[i]);
}