โ Back to Exceptions
Question 690
Rethrow With throw;
Rethrow With throw;
Read an integern. In an innertry, throw aDivideByZeroExceptionwhenn == 0, otherwise print100 / n. The innercatchprintsInner: logging errorand then rethrows the same exception with a barethrow;. The outercatch (Exception)printsOuter: handled. Use top-level statements with nestedtry/catch. Input4prints: 25 Input0prints: Inner: logging error Outer: handled
Expected Output:
25
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.