← Back to Exceptions
Question 760
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= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Exceptions
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.