98-361 · Question #46
The purpose of the Finally section in an exception handler is to:
The correct answer is A. 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 a
Question
The purpose of the Finally section in an exception handler is to:
Options
- AExecute code regardless of whether an exception is thrown.
- BConclude the execution of the application.
- CExecute code only when an exception is thrown.
- DBreak out of the error handler.
How the community answered
(26 responses)- A77% (20)
- B4% (1)
- C4% (1)
- D15% (4)
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.