Why should you write the cleanup code in Finally block?

Options
- Compiler throws an error if you close the connection in try block.
- Resource cannot be destroyed in catch block.
- Finally blocks run whether or not exception occurs.
- All of the above


CORRECT ANSWER : Finally blocks run whether or not exception occurs.

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement