You are viewing a single comment's thread. Return to all comments →
import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.lang.reflect.*; class Singleton{ private static Singleton obj; public String str; private Singleton() { } public static Singleton getSingleInstance() { if(obj==null) { obj=new Singleton(); } return obj; } }
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 →