← Quiz: Exceptions in Depth: all 10 questions
Quiz: Exceptions in Depth · Question 2 of 10
When does the else part of a try statement run?
When does the else part of a try statement run?
- A.Always, after finally
- B.Only when the try block raised no exception
- C.Only when an exception was caught
- D.Only when there is no finally block
Answer & explanation
Correct answer: Only when the try block raised no exception
else is the "it worked" branch.
Can you get the rest right without peeking?
Take the timed Quiz: Exceptions in Depth quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →