Use throws in method signatures to indicate that your method might throw an exception, requiring handling by the caller.
Source Code
public static void checkAge(int age) throws ArithmeticException {
if (age < 18) {
throw new ArithmeticException("Access denied - You must be at least 18 years old.");
} else {
System.out.println("Access granted");
}
}