Merits and demerits of inheritance

1 answer

Answer

1288449

2026-03-30 01:00

+ Follow

Inheritance has many merits, why it was implemented in the first place, it allows the reuse of code for similar classes, and it does an Excellence job of organizing class relations. One "demerit" one might argue would be the fact that poorly written parent classes could be easily hacked into, thus gaining access to the parent class's internal methods simply by extending it.

The issues in the parent class would be passed on to the children. If the memory management or Thread management in the parent class is very poor, then the child class would inherit these features and its performance would be affected and would remain bad.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.