這是我的情況,我有例外列表中包含不同層次一樣任意例外,和婁代碼卡扣將解釋什麼,我需要做的比較例外
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