PPT Slide
Some languages allow multiple inheritance:
Animal Pet (two superclasses)
- Multiple inheritance leads to many potentially confusing naming problems (e.g. Pet.doYourThing() vs. Animal.doYourThing())
- Growing consensus: the benefits of multiple inheritance aren’t worth the problems.
- Java has single inheritance only.
- Java doesn’t allow multiple inheritance
- Well, there is a restricted kind that avoids
most of the problems. It involves using
interfaces, which we’ll cover later)