A Java Factory Pattern (Factory method) example
Java Design Patterns FAQ: Can you provide an example of the Factory Pattern in Java?
Sure. In this article we'll look at a small-but-complete example of the Factory Pattern ("Factory Design Pattern") implemented in Java.