首页 > 代码库 > JAVA异常

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异常