Skip to content
Sharp

Core Java · interview question

Why does the 'throw' keyword matter in practice?

Multiple choiceMediumchapter-6-curatedpremiumcore-javathrow-throws-and-propagation
Choose one answer
Answer and explanation

Correct answer

C. To manually trigger an exception

Why

The 'throw' keyword is used to manually trigger an exception. It can be followed by a new instance of an exception type to be thrown during the execution of a method.

Test yourself on Core Java

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

Start free test
All Core Java questions →