โ Back to Exceptions
Question 670
Read the Exception Message
Read the Exception Message
Thetryblock throwsnew InvalidOperationException("operation not allowed"). Catch it and print the exception'sMessageproperty, which should print exactlyoperation not allowed. Use top-level statements withtry/catch. This program reads no input. The program always prints: operation not allowed
Expected Output:
operation not allowed
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.