class Single { private static Single s = null; private Single() { } private static Single getInstance() { if(s == null) { synchronized(Single.class) { if(s == null) { s = new Single(); } } } return s; } }