Why don't I need to declare an exception in a method [Java]?

后端 未结 0 479
南方客
南方客 2021-01-03 12:55

In the following Code::

public class Main {
  static void checkAge(int age) {
    if (age < 18) {
      throw new ArithmeticException("Access denied -         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题