The Singleton Pattern

The Singleton pattern is used when a class can only have one instance:

Utilities versus Singletons

All members of a utility class are static. For example java.lang.Math is a utility class. There is no need to create an instance of a utility class. In many cases designers have to choose between utility classes and singletons.

One subtle difference is this: if a utility class contains fields, they will be initialized when the class is loaded, even if they are never used. The fields of a singleton are initialized at the first call to makeInstance.