what is multi level inheritance give n example ?
Answer Posted / itishree
A class is derive from a class which is derive from another
class is known as multilevel inheritance.
example-grandpa->papa->son
another example:
class A
{
protected:
int x;
public:
void showA()
{
cout<<"enter a value for x:"<<endl;
cin>>x;
}
};
class B:public A
{
protected:
int y;
public:
void showB()
{
cout<<"enter value for y:";
cin>>y;
}
};
class C:public B
{
public:
void showC()
{
showA();
showB();
cout<<"x*y ="<<x*y;
}
};
void main()
{
C ob1;
ob1.showc();
}
| Is This Answer Correct ? | 256 Yes | 36 No |
Post New Answer View All Answers
What is multilevel inheritance explain with example?
What does I oop mean?
What is class and object in oops?
what is the drawback of classical methods in oops?
What is abstraction in oop with example?
what is graphics
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
Is this job good for future? can do this job post grduate student?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What are the 3 pillars of oop? What is abstraction oop? What does and I oop and sksksk mean? What is object-oriented programming? Webopedia definition What is balance factor?