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 encapsulation with example?
what type of question are asked in thoughtworks pair programming round ?
Templates mean
What is multilevel inheritance in oop?
Why is abstraction used?
What is the main feature of oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What are functions in oop?
Can destructor be overloaded?
what is the drawback of classical methods in oops?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
What is the difference between encapsulation and polymorphism?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
Why oops is important?