The finally block is always executed, no matter what. This may be helpful when throwing exceptions or leaving your function earlier.
See this sample which also calls finally
try {
return;
}
finally {
Console.writeline("executes inside Finally");
Console.readline();
}
Or this one:
try {
int[] arrobj = new int[2];
arrobj[0] = 45;
arrobj[1] = 54;
arrobj[2] = 43;
}
catch(Exception e) {
Console.writeline(e.Message);
Console.readline();
throw;
}
finally {
Console.writeline("executes inside Finally");
Console.readline();
}
In both cases the finally block is executed, but "normal" code after the catch handler/the return is not executed. So, in your case it may not make very much sense, but in the two samples from me they make sense.
See here for some more explanations:
http://msdn.microsoft.com/en-us/library/zwc8s4fz%28VS.80%29.aspx[
^]
Hope that helps!