Skip to content
Sharp

Object-oriented programming · interview question

How would you explain a limitation of using inheritance for code reuse in an interview?

Multiple choiceMediumchapter-5-curatedpremiumoopinheritance-basics
Choose one answer
Answer and explanation

Correct answer

A. It can lead to an inappropriate is-a relationship.

Why

Inheritance can lead to an inappropriate is-a relationship if the subclass does not truly represent a specialized type of the superclass, which might lead to poor design choices.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →