問題文
A try block completes without throwing anything, and the method has a matching catch block and a finally block. Which sequence describes what runs?
選択肢
- The try block runs, the finally block runs, and then the catch block runs so that cleanup happens before any handling code observes the state of the resources.
- The try block runs to its end, the catch block is skipped, and then the finally block runs before control leaves the statement.
- The try block runs, the catch block runs with a null exception reference, and the finally block runs last.
- The try block runs and the finally block is skipped, and finally exists only to clean up after an exception has actually been thrown somewhere in the try.