What are the limitations of inheritance?

Asked 07-Dec-2019
Viewed 3339 times

1 Answer


0

Inheritance, a very important concept in Object Oriented Programming, has a lot of advantages. Still, one cannot overlook the fact that it also has some disadvantages. The first one being that the improper use of inheritance or less knowledge of inheritance may lead to wrong solutions. Sometimes, data members in the base class, i.e., the class which everything is being inherited, are left unused which may lead to a lot of memory wastage. Moreover, the compiler has to keep records of the parent as well as the child class. Any change in the super class for instance the deletion of a particular aggregate function in the super class, shall change the entire sequence of the program or the inheritance relationship.

What are the limitations of inheritance?

A simple concept of inheritance