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
Explain the advantages of inheritance.
Why is encapsulation used?
write a C++ program for booking using constructor and destructor.
Get me an image implementation program.
What is difference between pop and oop?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
How is polymorphism achieved?
What is a superclass in oop?
Get me a number puzzle game-program
What is balance factor?
Whats oop mean?
What is difference between data abstraction and encapsulation?
Why polymorphism is used in oops?
What is encapsulation selenium?
How to call a non virtual function in the derived class by using base class pointer