Professional Documents
Culture Documents
T his is useful when one object is needed to coordinate actions across the system. public class Singleton { private static Singleton _instance; private Singleton() { //Constructor is private } public static synchronized Singleton getInstance() { if(null == _instance) { _instance = new Singleton(); } return _instance; } }