Back to the 2026 paper

Module 4: Exception Handling

20262m

Which keyword explicitly generates an exception?

(i) throws
(ii) exception
(iii) throw
(iv) catch

Worked SolutionAI Assisted

Answer: (iii) throw

throw explicitly throws an exception object. throws appears in a method declaration to announce exceptions that may propagate to the caller.

if (age < 18) throw new IllegalArgumentException("Underage");

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.