ArithmaticException(算数异常)运行时异常,继承自RuntimeException:
(Exception in thread "main" java.lang.ArithmeticException: / by zero
at Main.main(Main.java:5))
public class Main {
public static void main(String[] args) {
int num1 = 5;
int num2 = 0;
System.out.println(num1 / num2);
}
}
//Exception in thread "main" java.lang.ArithmeticException: / by zero
// at Main.main(Main.java:5)