Ref: Effective Java by Joshua Bloch
Occasionally you'll want to write a class that is just a grouping of static methods and static fields like java.util.Collections. Such utility classes were not designed to be instantiated, an instance would be nonsensical. A class can be made noninstantiable by including a private constructor.
No comments:
Post a Comment