🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Exception Handling: all 10 questions

Quiz: Java Exception Handling · Question 3 of 10

What is the difference between throw and throws?

What is the difference between throw and throws?

  1. A.They are the same
  2. B.throw throws an exception object; throws declares exceptions in a method signature
  3. C.throws throws an object; throw declares
  4. D.throw is only for errors
Answer & explanation

Correct answer: throw throws an exception object; throws declares exceptions in a method signature

throw new X(...) inside code; void m() throws X in the signature.

Can you get the rest right without peeking?

Take the timed Quiz: Java Exception Handling quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →