Skip to content
Sharp

Object-oriented programming · interview question

How would you explain a common problem with using deep inheritance hierarchies in Java application design in an interview?

Multiple choiceHardchapter-5-curatedpremiumoopcomposition-vs-inheritance
Choose one answer
Answer and explanation

Correct answer

B. Increased complexity and reduced flexibility.

Why

Deep inheritance hierarchies can lead to increased complexity and reduced flexibility because changes in the base classes can have unintended consequences in derived classes. It makes understanding and maintaining the codebase more challenging.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →