โ Back to Exceptions
Question 645
The finally Block
The finally Block
Read two integers and printResult: <a / b>. Catch aDivideByZeroExceptionand printError. In every case, printDonefrom afinallyblock (it runs whether or not an exception occurred). Use top-level statements. Input8then4prints: Result: 2 Done Input8then0prints: Error Done
Expected Output:
Result: 2 Done
Topics:
Exceptions
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.