Out of bound
public class eighteenb {
public static void main(String[] args) {
try {
int[] array = {10, 20, 30, 40, 50};
int index = 10; // This index is out of bounds for the array
int element = array[index]; // This line will throw the
ArrayIndexOutOfBoundsException
System.out.println("Element at index " + index + ": " +
element);
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Exception: Array index is out of
bounds.");
}
}
}