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

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.