Define inheretance?what are the types of Inheritance?



Suraj Said

+0 -0

Inheritance is a mechanism in object-oriented programming that allows one class to inherit properties and methods from another class. This allows for code reusability and eliminates the need for redundant code.
Single inheritance: One class inherits from a single base class.
Multiple inheritance: One class inherits from multiple base classes.
Multi-level inheritance: A class inherits from a class that inherits from another class.
Hierarchical Inheritance: multiple derived classes inherit from a single base class.



Submit Your Response