![if !IE]> <![endif]>
Explain multiple inheritances with suitable c++ coding.
• Inheritance is a mechanism of deriving a new class from a old class.
• It provides the concept of reusability
• By inheritance some or all the properties of a class can be derived in to another class.
• The class which provides the properties is called as base class and the class which derives the properties is called as derived class.
It is a type of inheritance in which a class can inherit properties from more than one class.
Class derivedclass name : visibility mode baseclass1,visibilitmode baseclass2
body of the derived class; };
visibility mode can be either private or public.
cout <<”\n enter the value for a\n”;
protected: int b;
public; void get1()
cout <<” \n enter the value for b \n”;
class dc : public bc1, public bc2
public : void show()
cout <<”The values of a and b are” ;
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.