Does Java support multiple inheritance
Answer: NO. In Java multiple inheritance is not permitted. It was excluded from the language as a design decision, primarily to avoid circular dependencies.
Scenario 1: Following is not possible in Java:
Scenario 2: However below is possible:
Basically the difference between above two approaches is that in the scenario 2 there is a clearly defined parent or super class, while in the scenario 1 the super class is ambiguous.
Think if as you see above both Animal and Mammal have a method nurse(). Under the first scenario which parent method would be called if we called Whale.nurse()? Under the second scenario, we know calling Whale.drink() would call the Mammal classes nurse method as long as Whale class had not overridden it.