java试题-以下代码片段有何问题?

public class Test {
    public static void main(String[] args) {
        int x = 10;
        int y = 0;
        try {
            int result = x / y;
        } catch (ArithmeticException e) {
            System.out.println("除数不能为零");
        }
    }
}

网友评论0