Catch specific exceptions for clearer, more precise error handling.
Source Code
try {
int[] myNumbers = {1, 2, 3};
System.out.println(myNumbers[10]);
} catch (IndexOutOfBoundsException e) {
System.out.println("Index is out of bounds!");
}