According to <<The Java Language Specification>> 8.2.1.4, if a class has a public superclass or superinterface, with the help of another public class in the same package that returns an instance of this class, instance of the class might be available at run time to codes outside its package, and its public methods, which implement or override the methods of its public superclass or superinterface, can be invoked through these instances.