posted 23 years ago
I recognize this question. The code won't compile because line 7 is unreachable, and the question is "removing which line(s) will allow this code to compile?" (or something like that).
The basic problem is that either line 6 or line 7 needs to be removed. If you have a return statement in a finally block, then any code following the finally block will never be executed, and is therefore unreachable, prompting a complaint from the compiler. Removing line 7 alone will resolve the problem.
You can, alternately, remove line 6. However, you would also then need to remove either line 3 or line 5 -- otherwise line 7 will remain unreachable because either line 3 or 5 will be executed 100% of the time.
There is no shortcut here, you just need to understand how return statements in try-catch-finally blocks may affect code following the block.