一般情況下
//: LostMessage
// How an exception can be lost
class VeryImportantException extends Exception {
public String toString() {
return
}
}
class HoHumException extends Exception {
public String toString() {
return
}
}
public class LostMessage {
void f() throws VeryImportantException {
throw new VeryImportantException();
}
void dispose() throws HoHumException {
throw new HoHumException();
}
public static void main(String[] args)
throws Exception {
LostMessage lm = new LostMessage();
try {
lm
} finally {
lm
}
}
} ///:~
輸出如下
A trivial exception
at LostMessage
at LostMessage
可以看到
這是一項相當嚴重的缺陷
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19779.html