Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is?
finally
something()
try
Example code:
public static void main(String[] args) { System.out.println(Test.test()); } public static int test() { try { return 0; } finally { System.out.println("finally trumps return."); } }
Output:
finally trumps return. 0