← Quiz: Error Handling and Debugging: all 10 questions
Quiz: Error Handling and Debugging · Question 10 of 10
What is finally best used for?
What is finally best used for?
- A.Handling only syntax errors
- B.Clean-up that must happen whether or not an error occurred, such as hiding a spinner
- C.Retrying the try block
- D.Declaring variables for catch
Answer & explanation
Correct answer: Clean-up that must happen whether or not an error occurred, such as hiding a spinner
finally runs in both the success and the failure path.
Can you get the rest right without peeking?
Take the timed Quiz: Error Handling and Debugging quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →