I was going through Effective java item 1, where "Static factory method vs constructors" for object creation is discussed. One of the disadvantages mentioned is the following:
"The main disadvantage of providing only static factory methods is that classes without public or protected constructors cannot be subclassed."
It is also mentioned that this is good since it will promote object composition to inheritance. However, is it not a serious limitation, when you indeed want inheritance? Why should I prefer static factory methods for object creation, when I do not know from before if the class is going to be extended or not?