0

In java by default all classes are inherit from Object class and even we can also inherit the classes.

class A{ // default **Object class** is extended

}
class B extends A{ 
           //default **Object class** is extended and also **class A** extended.
}

Then why we say that java doesn't support multiple inheritance through classes?

2
  • 1
    because at some point of the inheritance chain you will get to a class that inherits from object, but you can´t inherit from two classes at the same time. Commented Jan 13, 2016 at 7:09
  • @Kevin Esche That comment is the logical fallacy known as "begging the question". Commented Jan 13, 2016 at 7:19

1 Answer 1

1

It is just to remove ambiguity, because multiple inheritance can cause ambiguity in few scenarios. One of the most common scenario is Diamond problem.

Look at this page : http://www.instanceofjava.com/2014/12/why-java-does-not-supports-multiple.html

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.