Use multi-catch blocks to catch multiple types of exceptions in a single catch block, reducing code duplication.
Source Code
try {
int[] myNumbers = {1, 2, 3};
System.out.println(myNumbers[10]);
} catch (IndexOutOfBoundsException | NullPointerException e) {
System.out.println("Exception caught: " + e);
}