测试

test

public class Main {
    public static void main(String[] args) {
        int a = 1;
        try {
            int b = a / 0;
            System.out.println(b);
        } catch (ArithmeticException e) {
            e.printStackTrace();    // printStackTrace() 控制台输出异常栈跟踪
        } finally {
            System.out.println("done");
        }
        System.out.println(a);
    }
    //java.lang.ArithmeticException: / by zero
    //    at exception.Main.main(Main.java:7)
    //done
    //1
}
powered by GitbookFile Modify: 2023-05-31 21:17:54

results matching ""

    No results matching ""

    results matching ""

      No results matching ""