الرجوع
تسجيل الدخول

What will be the output of the following code?

public class Test {
    public static void main(String[] args) {
        try {
            validate(10);
        } catch (Exception e) {
            System.out.println("Exception: " + e.getMessage());
        }
    }

    static void validate(int age) {
        if (age < 18)
            throw new ArithmeticException("Not valid");
    }
}