1
JavaAdvanced#puzzle#collections
The finally block's return statement overrides the try block's return, so the method returns 2. This is a well-known gotcha — avoid returning from finally blocks in real code.
int test() {
try { return 1; } finally { return 2; }
}
System.out.println(test()); // Output: 2