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