ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C++ >> OOPS
 
 


 

 
 STL interview questions  STL Interview Questions (93)
 OOPS interview questions  OOPS Interview Questions (563)
 C++ General interview questions  C++ General Interview Questions (461)
Question
what is multi level inheritance give n example ?
 Question Submitted By :: OOPS
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
The best example is Say we have 3 class
ClassA,ClassB and ClassC.

ClassB is derived from ClassA and ClassC is derived ClassB
this is multi level inheritance..

ClassA
^
|
|
ClassB
^
|
|
ClassC
 
Is This Answer Correct ?    329 Yes 48 No
Roshan P R
 
Answer
# 2
derived a new class from another derived class.It is known
as multilevel inheritance.
example:
grandfather->father->son.
 
Is This Answer Correct ?    253 Yes 30 No
Aswini.s
 
 
 
Answer
# 3
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 ?    252 Yes 35 No
Itishree
 
Answer
# 4
The best example is Say we have 3 class
ClassA,ClassB and ClassC.

ClassB is derived from ClassA and ClassC is derived ClassB
this is multi level inheritance..

ClassA
^
|
|
ClassB
^
|
|
ClassC
 
Is This Answer Correct ?    99 Yes 18 No
Mohd Aqeel Ahmed
 
Answer
# 5
"A type of inheritance in which a class is derived from
another derived class is called multilevel inheritance."

in multilevel inheritace,the members of parent class are
inherited to the child class and the member of child class
are inherited to the grand child class.
for example
class A
^
class B
^
class C
 
Is This Answer Correct ?    63 Yes 9 No
Ansar Ali Gujjar
 
Answer
# 6
A class is derive from a class which is derived from another
class is known as multilevel inheritance.
example-grandpa->papa->son.
 
Is This Answer Correct ?    45 Yes 11 No
Umesh Kumar Vishwakarma
 
Answer
# 7
To creat a new class from a base class which is in terms of
derive from another base class is known as multilevel
inheritance.
 
Is This Answer Correct ?    34 Yes 11 No
Ashok Kumar Nayak
 
Answer
# 8
A->B->C 
Is This Answer Correct ?    26 Yes 11 No
Simran
 
Answer
# 9
when a derived class inherits an already created derived
class ,then it is known as multilevel inheritance.

A->B->C
HERE A IS A BASE CLASS.B IS AN INTERMEDIATE BASE CLASS ,AS
IT PROVIDES A LINK FOR THE INHERITANCE BETWEEN A & C.C IS A
DERIVED CLASS.
EG. GRANDFATHER
|
FATHER
|
CHILD

THE CHAIN IS KNOWN AS INHERITANCE PATH.
 
Is This Answer Correct ?    19 Yes 5 No
Radha
 
Answer
# 10
The process of inheriting a new class from the already inherited class is called as multilevel inheritance.
example:
Class A
|
|
Class B
|
|
Class C
 
Is This Answer Correct ?    1 Yes 2 No
Vidhya
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
difference between abstraction and encapsulation with progarammatic eg. hi,just recently i went for an interview .The interviewer asked what is the difference between abstraction and encapsulation with programmatic eg. I gave the answer as encapsulation mean hiding the relevant data which is not useful for the user, eg a electric fan .hiding the information how the electricity is converted into machanical energy. abtraction showing only the relevant data to the user eg electric fan. it look ,its color ,it design etc only relevant data. Then the interviewer asked me, give me some programmic eg .I Said Let assume a web form having control like textbox,button etc. The user can view textbox,button etc this is the eg of abstraction and when the user click on the button how he is redirected is not known by the user is the eg of the encapsulation. Am I Correct .was the answer given by me is perfect .now i am planing to go for an another interview should i give the same answer.IF not please suggest me a better answer.with some good eg Please help   1
What is difference between function overloading and overriding? emc2 1
How compiler selects(internally) required overridden function in inheritance? CSC 2
c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess TCS 1
what is oops DELL 4
What is Object and Class? What are the differences between them?   5
What are the access specifiers avaible in c++?   4
me get an assignent n its question is this 1.creat a set as in math i.ea={1,2} 2.insert element in it3. delete element don,t repeat any element 4.union 5. intersection of two sets plz help me i always pray for u n send me at ayeshawzd@hotmail.com f u have c++ how to program 5th addition then it is the 10.9 question in 10th chapter exercise   1
//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }   1
When is an object created and what is its lifetime? IBM 4
What is the difference between the C & C++? HCL 9
what is multithreading in c++ , what is difference between multithreading and singlethreading.   4
 
For more OOPS Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com