posted 20 years ago
Got it from Dr Heinz Kabutz's newletter(www.javaspecialist.co.za).
Ok , I knew the stuff you've told me , that no matter what , code in the finally block always gets executed.I ran the debugger on the code , with a break point set at line 1. When we reach line 1 the expected happens.i is incremented , then we hit the return statement , but immediately jump to line 4 to execute the finally block,where i is decremented back to
0(line5).But then , after that , there is a jump back to line 1 , then line 2 is skipped and then line 3 is executed(return), and the value 1 is finally printed out.