If a class does not extend any class, the compiler builds a class that extends directly from Object. public class MainClass { public static void main(String[] argv) { System.out.println(); } } class MyClass { } class MyAnotherClass extends Object { }