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

Quiz: Exceptions in Depth · Question 5 of 10

What should a custom exception class usually inherit from?

What should a custom exception class usually inherit from?

  1. A.BaseException
  2. B.object
  3. C.Exception (or one of its subclasses)
  4. D.KeyboardInterrupt
Answer & explanation

Correct answer: Exception (or one of its subclasses)

BaseException is reserved for system-exiting exceptions like KeyboardInterrupt.

Can you get the rest right without peeking?

Take the timed Quiz: Exceptions in Depth quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →