-5

Yeah the title pretty much describes the question.

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

4

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.