98-361 · Question #190
The purpose of the Finally section in an exception handler is to:
The correct answer is C. Execute code regardless of whether an exception is thrown. By using a finally block, you can clean up any resources that are allocated in a try block, and you can run code even if an exception occurs in the try block. Typically, the statements of a finally block run when control leaves a try statement. The transfer of control can occur…
Question
The purpose of the Finally section in an exception handler is to:
Options
- AExecute code only when an exception is thrown.
- BBreak out of the error handler.
- CExecute code regardless of whether an exception is thrown.
- DConclude the execution of the application.
How the community answered
(37 responses)- A3% (1)
- B8% (3)
- C84% (31)
- D5% (2)
Explanation
By using a finally block, you can clean up any resources that are allocated in a try block, and you can run code even if an exception occurs in the try block. Typically, the statements of a finally block run when control leaves a try statement. The transfer of control can occur as a result of normal execution, of execution of a break, continue, goto, or return statement, or of propagation of an exception out of the try statement.
Topics
Community Discussion
No community discussion yet for this question.