这是我的情况,我有例外列表中包含不同层次一样任意例外,和娄代码卡扣将解释什么,我需要做的比较例外
private List<java.lang.Class> connectionExceptions;
try {
// trying to connect to external module;
} catch(Exception e) {
// Need to compare this exception e with a list of exceptions which I have,
// and the action depends on the results. There may be some other exception
// which are not in the list.
}
所以,我怎么能比例外,我需要某种行动,如果例外是在列表中或其他...
我知道,控制流取决于例外是不好的做法。但是,我需要这样做。
为什么不能使用'List''? –
KrishPrabakar
2015-03-09 11:01:00