Question: What is the purpose of the 'finally' block in exception handling?Answer: The 'finally' block in exception handling always executes, whether an exception is thrown or not. It is used to release resources or perform cleanup tasks.Example:
|
Is it helpful?
Yes
No
Most helpful rated by users:
- What is the difference between a stack and a queue?
- What is the purpose of an index in a database?
- What is the purpose of the \'git\' version control system?