Why inheritance is important and types of inheritance
Answer:
It is the most important concept of OOPS.
Inheritance enables code reusability and saves time.
Inheritance is used to declare characteristics of classes inheriting it. It allows developer to create classes that are built upon existing classes :-
to specify a new implementation while maintaining the same behaviors,
to reuse code and to independently extend original software via public classes and interfaces.
It means that child class may use the code defined in the parent class without re-writing the same code.
Inheritance is very essential for expandability.
Types of Inheritance
1. Single inheritance.
2. Multi-level inheritance.
3. Multiple inheritance.
4. Hierarchical Inheritance.
5. Hybrid Inheritance.