public class Singleton {
static class SingletonHolder {
static Singleton instance = new Singleton();
}
public static Singleton getInstance() {
return SingletonHolder.instance;
}
}
See in : http://crazybob.org/2007/01/lazy-loading-singletons.html
See also : http://www.oreillynet.com/onjava/blog/2007/01/singletons_and_lazy_loading.html