Question: What is the purpose of the finally block?
- To always run the finally block of code when the try block exits
- To run code when an exception has not occurred
- To run the block if an exception occurred
- To run code whenever garbage collection requires it
Answer: The correct answer of the above question is Option A:To always run the finally block of code when the try block exits