Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is?
finally
something()
try
finally is always executed and before returning x's (calculated) value.
x
System.out.println(foo()); .... int foo(){ int x = 2; try{ return x++; } finally{ System.out.println(x); } }
Output:
3 2