/DeadlyDiamond

Multiple and Repeated Inheritance in C++ and Java

Primary LanguageC++

DeadlyDiamond

Multiple and Repeated Inheritance in C++ and Java

Inheritance in object-oriented programming allows for the derivation of new classes from existing classes [1]. The most notable difference between C++ and Java is that C++ allows for multiple and repeated inheritance. That is, a subclass can be defined in C++ that inherits non-private functions and variables from more than one base class. Java, on the other hand, is limited to single inheritance. This project explores the advantages and hazards of multiple inheritance in C++ and endeavors to recreate a similar structure in Java through the use of abstract classes and interfaces.

[1] Liang, D. 2011. Introduction to Java Programming: Comprehensive Version, Pearson, Upper Saddle River, NJ, 374.