Inharitance dafination
- Inheritance is an important feature of object oriented programming concept which describe different rule and regulation. A class can be define a return type value. It is a process in which one class acquire the property of another class with the help of object oriented concept. The old class in a program know as base class which transfer proper to new class know as derived class. The derived class inherit property of base class create a parent-child relationship.
Types of inheritance
1). Single Inheritance
- A derived class with only one base class know as single inheritance with the help object oriented concept.
(2). Multiple inheritance
- A derived class with many base class know as multiple inheritance
4). Hybrid inheritance
- It support the concept of tree and multiple inheritance with the help of object oriented programming concept know as Hybrid inheritance. It means Hybrid inheritance combination of tree and multiple inheritance .
5). Tree inheritance
6). Virtual base class inheritance
- All three type of inheritance that is multilevel, multiple and tree in virtual base class inheritance. A class is made a virtual. Than C++ language take a necessary condition which check only one copy of the class is inherit.
Virtual base class inheritance example
Class A
{
Member
Function
} ;
Class B1 : Virtual public A
{
Member function
} ;
Class B 2 : Virtual public A
{
Member function
} ;
Class C : public B1 , public B2
{
Member function
} ;
No comments:
Post a Comment
If you have any doubts, Please lets me know and Please Follow our Website