public class SingletonObject {
private static volatile SingletonObject instance;
private SingletonObject() {
}
public static SingletonObject getInstance() {
if (instance == null) {
synchronized (SingletonObject.class) {
if (instance == null) {
instance = new SingletonObject();
}
}
}
return instance;
}
}