What is the purpose of the finally block in a try/catch/finally?
- A It runs only if no error occurred
- B It runs only if an error occurred
- C It always runs regardless of whether an error was thrown
- D It suppresses all errors
Answer
It always runs regardless of whether an error was thrown
finally is used for cleanup such as closing resources or hiding a loading indicator. It executes even if the try or catch block returns.





