第1个回答 2008-11-24
public class Test1 {
public void good() throws MyException {
try {
better();
} catch (Exception other_exception) {
other_exception.printStackTrace();
}
}
public void better() throws MyException {
throw new MyException("exception");
}
}
//自定义异常
public class MyException extends Exception {
public MyException(String msg){
super(msg);
}
public String toString()
return super.toString();
}
}
}