G
Guest
Maybe I'm missing something here, but I can't see the purpose of the
'finally' keyword. What is the difference between:
try
{
doSomething()
}
catch
{
handleError();
}
finally
{
tidyUp()
}
and
try
{
doSomething()
}
catch
{
handleError();
}
tidyUp()
as far as I can tell in both cases tidyUp() gets executed whether an
exception occurs or not.
'finally' keyword. What is the difference between:
try
{
doSomething()
}
catch
{
handleError();
}
finally
{
tidyUp()
}
and
try
{
doSomething()
}
catch
{
handleError();
}
tidyUp()
as far as I can tell in both cases tidyUp() gets executed whether an
exception occurs or not.