Answer Posted / guest
You can derive a class from any number of base
classes. Deriving a class from more than one direct base
class is called multiple inheritance.
In the following example, classes A, B, and C are
direct base classes for the derived class X:
class A { /* ... */ };
class B { /* ... */ };
class C { /* ... */ };
class X : public A, private B,
public C { /* ... */ };
The following inheritance graph describes the
inheritance relationships of the above example. An arrow
points to the direct base class of the class at the tail of
the arrow:
The order of derivation is relevant only to determine the
order of default initialization by constructors and cleanup
by destructors.
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
What is difference between abstraction and encapsulation?
Who invented oop?
Why is polymorphism used?
What is the advantage of oop over procedural language?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
Why it is called runtime polymorphism?
Is data hiding and abstraction same?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
what is the sylabus for priliminaries?
What is abstraction in oop with example?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
What is meant by multiple inheritance?
What is the difference between a mixin and inheritance?
What do you mean by variable?
What is encapsulation and abstraction? How are they implemented in C++?