public volatile static Singleton singleton;
public Singleton() {
super();
// TODO Auto-generated constructor stub
}
public static Singleton getSingleton() {
if(singleton == null){
synchronized (Singleton.class) {
if(singleton == null){
singleton = new Singleton();
}
}
}
return singleton;
}
public Singleton() {
super();
// TODO Auto-generated constructor stub
}
public static Singleton getSingleton() {
if(singleton == null){
synchronized (Singleton.class) {
if(singleton == null){
singleton = new Singleton();
}
}
}
return singleton;
}