You are viewing a single comment's thread. Return to all comments →
class Singleton{
private static Singleton instance; public String str; private Singleton() { } public static Singleton getSingleInstance() { if(instance == null) { synchronized(Singleton.class) { if(instance == null) { instance = new Singleton(); } } } return instance; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Java Singleton Pattern
You are viewing a single comment's thread. Return to all comments →
class Singleton{
}