可能重複:
Is there such case when in try\finally block the finally won't be executed?`try`塊幫助Java
我是比較新的Java和我剛聽到try-catch
塊(3分鐘前要準確)。
在try-catch
塊中,finally
部分(何時存在)有不是執行?
try {
if (choice) {
//...
} else {
//...
}
} finally {
doesThisEverNOTrun();
}
的可能重複[有沒有這樣的情況下,嘗試\當finally塊最終將不會被執行?](http://stackoverflow.com/questions/3484353/is-there-such-case-when-in -try-finally-block-the-finally-wont-be-executed)和http://stackoverflow.com/questions/6228528/和http://stackoverflow.com/questions/464098/ –
[是](http: //thedailywtf.com/Articles/My-Tales.aspx)。 ;) –