JAVA异常

ArithmeticException----->by zero

public class ExceptionDemo1 {
    public static void main(String args[]) {
        System.out.println("********** BEGIN *************");
        int i = 10;
        int j = 0;
        try {
        int temp = i / j;
        System.out.println("result: " + temp);
        System.out.println("**************************");
        } catch(ArithmeticException e) {
            System.out.println("Exception occurs at Info: " + e);
        }
        System.out.println("*********** END ***************");
    }
}
原文地址:https://www.cnblogs.com/daishuguang/p/3997329.html