public class Main {
static void checkAge(int age) {
if (age < 18) {
throw new ArithmeticException("访问被拒绝 - 您必须年满18岁。");
} else {
System.out.println("访问已授权 - 您已满足年龄要求!");
}
}
public static void main(String[] args) {
checkAge(20);
}
}