public class SingletonOnDemand {
private SingletonOnDemand () {}
private static class Singleton {
private static final SingletonOnDemand instance = new SingletonOnDemand();
}
public static SingletonOnDemand getInstance () {
System.out.println("create instance");
return Singleton.instance;
}
}