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

Quiz: Inheritance · Question 10 of 10

Why are deep inheritance chains (5 or more levels) a problem?

Why are deep inheritance chains (5 or more levels) a problem?

  1. A.Java does not allow more than 3 levels
  2. B.They make programs run out of memory
  3. C.They create tight coupling and are hard to follow; a change high up can break many classes
  4. D.They disable method overriding
Answer & explanation

Correct answer: They create tight coupling and are hard to follow; a change high up can break many classes

Prefer shallow hierarchies, and composition where "is-a" is not clearly true.

Can you get the rest right without peeking?

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

Start the quiz →