Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multiple Inheritance & Interfaces

Similar presentations


Presentation on theme: "Multiple Inheritance & Interfaces"— Presentation transcript:

1 Multiple Inheritance & Interfaces

2 Multiple Inheritance Can inherit from two different classes:
Get functionality from both

3 Multiple Inheritance Issues Same member in both
Person and Employee both have name

4 Multiple Inheritance Class D has B::x and C::x

5 Multiple Inheritance Issues Diamond inheritance
Copier gets two copies of PoweredDevice

6 Multiple Inheritance Class D has two different A objects that are a part of it!!!

7 Interfaces Interface : Class that only declares behaviors, does not implement anything Only has pure virtual methods Can't have any non-static member variables

8 Interfaces Interface : Defines class of object that has given behavior
Use as a type for semi-generic functions, structures Language feature in Java, conceptual entity in C++


Download ppt "Multiple Inheritance & Interfaces"

Similar presentations


Ads by Google