問題文
A method has a try block that raises an IllegalStateException, a catch block for that type which returns the value 1, and a finally block that writes one line to the console. What does the method do when it runs?
選択肢
- The value 1 reaches the caller at once and the finally block is skipped, because a return inside a handler leaves the method immediately
- The exception reaches the caller together with the value 1, because the finally block raises again what the try block raised
- The finally block writes its line first because it is scheduled ahead of the handler, and the catch block produces the value 1 after that has happened
- The catch block runs first, then the finally block writes its line to the console, and after all of that the value 1 reaches the caller