I have this java code with nested try:
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();
}
I want to know if finally
is always executed when I get an exception. I ask this because catch blocks have return
or continue
statements.
When is doSomeThingVeryImportant()
executed? When I get an Exception
on when I get a NumberFormatException
?
I only want if after any catch block is executed, the finally block is executed also.