throw explicitly throws an exception. Immediately halts current execution and transfers control to a catch block. Can throw only one exception at a time.
throws declares that a method might produce an exception. Does not execute anything. Can declare multiple exceptions separated by commas.
public void checkAge(int age) {
if (age < 18) {
throw new ArithmeticException("Access denied - You must be at least 18.");
}
}
void checkAge(int age) throws Exception {
if (age < 18) {
throw new Exception("Not eligible");
}
}