What are the limitations of inheritance?

0 votes
149 views
Shikhar Arora asked 07-Dec-2019 in Technology by Shikhar Arora

What are the limitations of inheritance

1 Answer

0 votes
Sangsaptak Pal answered 17-Jan-2020 by Sangsaptak Pal

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