Skip to content
Sharp

Core Java · interview question

Which Java keyword would you use to manually throw an exception in Java?

Multiple choiceEasychapter-6-curatedpremiumcore-javacode-reading-with-exceptions
Choose one answer
Answer and explanation

Correct answer

B. Throw

Why

The 'throw' keyword is used to explicitly throw an exception in Java. It is typically used inside a method or block of code to indicate an error condition.

Test yourself on Core Java

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

Start free test
All Core Java questions →