Whenever we want an object to initialize itself, we normally go for public constructor definition. But have you ever think about static factory method? A class can provide similar or some addition fetchers as in constructor to its clients with static factory method.
Factory methods are simply methods that instantiate objects. Some factory methods in the Java 2 API that you would likely have used are the getInstance() and valueOf() methods. getInstance() is the conventional instantiation method...
Continue reading ...