
Inheritance:-
Inheritance
means using the Pre-defined Code This is very Main Feature of OOP With
the advantage of Inheritance we can use any code that is previously
created. With the help of inheritance we uses the code that is
previously defined but always Remember, We are only using that code but
not changing that code.
With
the Advent of inheritance we are able to use pre-defined code and also
able to add new code. All the pre-defined code is reside into the form
of classes if we want to use that code then we have to inherit or extend
that class.
Types of Inheritance
In C++, we have 5 different types of Inheritance. Namely,- Single Inheritance
- Multiple Inheritance
- Hierarchical Inheritance
- Multilevel Inheritance
- Hybrid Inheritance (also known as Virtual Inheritance)
No comments:
Post a Comment