Why is multiple inheritance not supported in java?

Why is multiple inheritance not supported in java?

When one class extends more than one class, this is called multiple inheritance. The problem with multiple inheritance is that there is a possibility of ambiguity i.e two classes may define different ways of doing the same thing and the subclass which will inherit from the previous class can't choose which one to pick. So, in order to avoid this problem, Java does not support multiple inheritance.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.