What does the finally block guarantee?
- A It runs only when no exception occurs
- B It always runs, whether or not an exception was thrown
- C It suppresses the exception
- D It runs before the try block
Answer
It always runs, whether or not an exception was thrown
finally is used for cleanup such as releasing a lock or closing a resource, and executes even if try or catch returns.





