Abstract classes should not have abstract methods. This is how it is usually done.
Now Calendar.getInstance() works, actually creating an instance of the subclass. You can call it because it is a static method. The return value refers to an instance of the corresponding subclass, but the return type is just Calendar , which is good due to the usual inheritance rules.
Here is an example of the same approach, but without all the complexities of Calendar - the same principles apply:
abstract class AbstractParent { public static AbstractParent getInstance() {
Jon skeet
source share