Classes that don't inherit Object class

According to Java Object superclass, java.lang.Object does not extend Object.

Other than that, all classes, i.e.

class ClassName {
    //some stuff
}

implicitly extend Object class, if they don't extend any other super-class.

Interfaces, on the other hand, do not extend Object, as Interface, by definition, can not extend Class. Also, Interfaces can not contain callable methods, nor can objects be instantiated from them. When interfaces are finally implemented, the implementing class will necessarily extend Object (and, no, Object doesn't implement or extend any other entity/class/interface).


According to java.lang.Object javadoc

Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.

So, all objects in Java extends it directly or indirectly.

Tags:

Java

Object