You are on page 1of 1

************************************************* CREATIONAL PATTERNS ************************************************* Singleton ========== It is a design pattern which restricts instantiation of a class to one object.

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; } }

You might also like