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 ***************");

    }

}

 

你可能感兴趣的:(JAVA异常)