public class Singleton{
private volatile static Singleton s;
private Singleton (){}
public static Singleton getSingleton(){
if(s==null){
synchronized(Singleton.class){
if(s==null){
s=new Singleton();
}
}
}
return s;
}
}