-5

Yeah the title pretty much describes the question.

Are there any advantages to non allowing multiple inheritance in a programming language?

user3150201
  • 1,901
  • 5
  • 26
  • 29

1 Answers1

1

It removes the possibility of the so called "diamond problem" (http://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem) that can occur when a class inherits from two classes having different implementations of methods of the same name.

Java instead have interfaces. A class can implement any number of interfaces and you can use a reference of the interface type to refer to any object of a class that implements this interface. Interfaces does not contain implementations and cannot be instantiated.

LoPoBo
  • 1,767
  • 1
  • 15
  • 26