大家猜猜结果是什么?
binny 2003-05-02 10:23:11 ==========C.class==============
public class C {
public static void main(String[] aa) throws myException{
C c = new C();
c.doIt();
}
// public boolean doIt() throws myException {
public void doIt() throws myException {
A a = new A();
try{
a.dothrow();
} catch (myException e) {
try{
a.dothrow();
} catch (myException e1) {
throw new myException();
// return true;
}
} finally {
//return false;
throw new myException();
}
}
}
==========A.class==============
class A {
public void dothrow() throws myException {
throw new myException();
}
}
=========myException.class=====
class myException extends Exception {
}
大家猜猜结果是什么?Exception 是从哪里抛出来的?如果把Exception改为boolean,那最后的返回结果是什么?
希望大家先想想再运行