以下のコードを考慮すると、catch句で例外がスローされた場合でも最終的に実行されますか?
try {
//code here throws exception
}
catch(Exception ex) {
//code catches above exception however code here also throws another exception
}
finally {
//does this code even run considering the exception thrown in the above catch clause??
}
回答:
回答№1の場合は7はい、そうです。 try / catchで何が発生しても実行されます(何らかの理由でJVMがシャットダウンしないと仮定)