This question is based on a misunderstanding.
But, what about the Object class? Say you have an object A that inherits from the Object class. Now, you create a class B that inherits from the A class. But, with every class inheriting the Object class, isn't B exhibiting multiple inheritance by both inheriting from Object and A?
The misunderstanding is here - "with every class inheriting the Object class"
In fact, an class only (implicitly) extends Object
if it does not explicitly extend
another class.
Object
is the ultimate superclass of every class, but it is not a direct superclass of every class. The Java class hierarchy is a tree, with Object
at the top.