All Questions
1 question
3
votes
3
answers
519
views
What's a good example of a static factory method returning instances of subclasses?
One benefit of having a class provide a static factory method rather than public constructors is the method can return an instance of a subclass.
For example, if the class ...