-3

Does java support multiple inheritance? (https://i.stack.imgur.com/PkhMD.png)

2 Answers2

0

If we are talking about classes and one class extend 2 other classes at the same time, the answer is no.

But, If you are using Java 8, you can achieve multiple inheritance with interfaces with default methods.

Check this here: https://www.geeksforgeeks.org/java-and-multiple-inheritance/

Brother
  • 2,150
  • 1
  • 20
  • 24
0

The short answer is No.

But developers still wanted something similar so they created interfaces! A class can implement as many interfaces as you want!

A better explanation of what interfaces are, and how they can be used can be found at this link.

Locke
  • 7,626
  • 2
  • 21
  • 41