public class Singleton {
private Singleton(){
if(s!=null) throw new RuntimeException("enough");
}
private static volatile Singleton s;
public static Singleton getInstance(){
if(null==s){
synchronized (Singleton.class) {
if(null==s){
s=new Singleton();
}
}
}
return s;
}
}