Skip to content

Inheritance

Devrath edited this page Feb 25, 2024 · 3 revisions

Inheritance

Definition

  • In Object-oriented programming Inheritance is a process of inheriting the functionalities of a parent, Possibly properties, functions, and other elements.
  • Inheritance enables code re-use, and extensibility.

Problem associated with long inheritance tree

  • Utilizing the Inheritance for code reuse is not a good approach.
  • Because there might be the possibility of creating a good class due to a massively long inheritance tree where due to inheritance there is so much code present that's not used for a specific purpose.