Define Inhertance(BCA- 3rd sem)


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.

https://bcastudy21.blogspot.com/2020/05/define-inhertancebca-3rd-sem.html?m=1


(2). Multiple inheritance 

  • A derived class with many base class know as multiple inheritance 



3).Multi level inheritance

  • The method of a derived class from another derived class is kown as multi level inheritance.
https://bcastudy21.blogspot.com/2020/05/define-inhertancebca-3rd-sem.html?m=1


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 .


https://bcastudy21.blogspot.com/2020/05/define-inhertancebca-3rd-sem.html?m=1


5). Tree inheritance

  • The property of may be inherit by more than. One derived class know as tree inheritance.
https://bcastudy21.blogspot.com/2020/05/define-inhertancebca-3rd-sem.html?m=1


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.


https://bcastudy21.blogspot.com/2020/05/define-inhertancebca-3rd-sem.html?m=1



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