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 are the ways in which a constructors can be called?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
Which method cannot be overridden?
What is oops and why we use oops?
What is the example of polymorphism?
What is pointer in oop?
What is encapsulation with example?
What is the fundamental idea of oop?
What is the diamond problem in inheritance?
What is the point of oop?
What does and I oop mean?
Can bst contain duplicates?
What is a function in oop?
Where is pseudocode used?
What polymorphism means?