Skip to content
Sharp

Exceptions · interview question

Which Java keyword is used to define a block of code that can throw an exception?

Multiple choiceEasychapter-6-curatedpremiumexceptionsfail-fast-validation
Choose one answer
Answer and explanation

Correct answer

C. Try

Why

The 'try' keyword is used to define a block of code that might throw an exception, and it must be followed by one or more 'catch' blocks or a 'finally' block.

Test yourself on Exceptions

A free test with instant, explained results. No account needed.

Start free test
All Exceptions questions →