← 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?
- A.Java does not allow more than 3 levels
- B.They make programs run out of memory
- C.They create tight coupling and are hard to follow; a change high up can break many classes
- 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 →