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