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 abstract class in oops?
What are the 3 pillars of oop?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
Whats oop mean?
What is and I oop mean?
what is difference between class template and template class?
What is overloading in oop?
what are the ways in which a constructors can be called?
What language is oop?
What is interface? When and where is it used?
What is the example of polymorphism?
Get me an image implementation program.
What is a class and object?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?