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

 

posted @ 2014-09-27 21:58  daishuguang  阅读(92)  评论(0编辑  收藏  举报