public class Singleton { /* eager instantiation */ private static final Singleton INSTANCE = new Singleton(); private Singleton() { /* initialization code */ } /* obtain the one and only instance */ public static Singleton getInstance() { return INSTANCE; } }