Is java.lang.Object superclass of all the custom class/objects inherited implicitly? I thought java didn't support multiple inheritance. The reason I ask is if I already inherit from another class in my custom class and again java is forcing implicit inheritance of java.lang.Object on top of it, is it not multiple inheritance?
Also, is java.lang.class Class also the superclass for all custom classes/Objects? If not, how in java reflections we can get the type of class for any class passed or call isInstance on any object?
解决方案
Everything is an Object, that said you could see the structure as this:
Object
Animal
Cat
and not as this:
Object Animal
Cat
Where Cat extends both, it's not like this last example, but it's Cat that extends Animal which extends Object.