There's nothing in Java that says that a method in a class can only return object types that the class inherits from. Your Applet is running in some sort of environment (a context, if you will). The Applet.getAppletContext method returns an AppletContext object which describes this environment.