public class TestException {
public static void main(String [] args) {
TestException te = new TestException();
te.m(0);
void m(int i)throws ArithmeticException{
if(i==0)
throw new ArithmeticException("被除数为0");
}
}
}
我这个抛出的异常哪个地方错了呢?我们老师就是这样写,没有看到它出错的呀?我说的是编译出现错误,不是运行的啊?
public class TestException { public static void main(String [] args) { TestException te = new TestException(); //te.m(0); } public void m(int i)throws ArithmeticExc...