ネストされたtryを含むこのJavaコードがあります:
try
{
try
{
[ ... ]
{
catch (Exception ex)
{
showLogMessage(ex);
return;
}
while (condition == true)
{
try
{
[ ... ]
{
catch (Exception ex)
{
showLogMessage(ex);
continue;
}
[ ... ]
}
}
catch (NumberFormatException e)
{
showLogMessage(e);
}
finally
{
doSomeThingVeryImportant();
}
finally
例外が発生したときに常に実行されるかどうかを知りたいです。return
catch ブロックにはorcontinue
ステートメントがあるため、これを尋ねます。
いつdoSomeThingVeryImportant()
実行されますか?私が得たException
とき、私はNumberFormatException
?
catch ブロックが実行された後に、finally ブロックも実行される場合にのみ必要です。