Effective Java By Joshua Bloch: Item1 - Static Factory Method
I am reading the Effective Java by Joshua Bloch and I have question about Item1 Static Factory Method . Quote[Bloch, p.7] Interfaces cant have static methods, so by convention, static factory methods for an interface named Type are put in non-instantiable class named Types. For example, the Java Collections Framework, provide unmodifiable collections, synchronized collections, and the like. Nearly all of these implementations are export via static factory methods in one noninstantiable class (java.util.Collections). The classes of the returned objects are all non-public. Ok. When look at the