public static Singleton getInstanceDC() {
if (_instance == null) { // Single Checked
synchronized(Singleton.class) {
if (_instance == null) {// Double checked
_instance = new Singleton();
}
}
}
return _instance;
}
public static synchronized Singleton getInstanceTS() {
if (_instance == null) {
_instance = new Singleton();
}
return _instance;
}
No comments:
Post a Comment