If one class is derived from another that is derived from Object, is that “multiple inheritence”

前端 未结 7 1642
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 09:56

The fact about Java is that it does not support the multiple inheritance.

But I have a question that the base class of all java classes is Object.

Now we have tw

7条回答
  •  天命终不由人
    2021-01-29 10:11

    What you describe is not multiple inheritance; B inherits from a single super class, A and A inherits from a single super class, Object. B gains the properties and methods of both A and Object, but this is via a single 'chain'of inheritance.

    Multiple inheritance is where a class inherits directly from more than one, unrelated class. This is not possible in Java.

提交回复
热议问题