public static Singleton getInstance() { if(cb == null){ cb = new Singleton(); } return cb; }
public static Singleton GetObject() { if(_obj==null) { _obj = new Singleton(); } return _obj; }
public static Singleton GetInstance() { if (_instance == null) { lock (_lockObject) { _instance = new Singleton(); } } return _instance; }
public static Singleton GetInstance() { return(_uniqueInstance ?? (_uniqueInstance = new Singleton())); }
private static void DisplayEmployee() { Singleton employee = Singleton.GetInstance; employee.PrintDetails("From Employee"); }
private static void DisplayStudent() { Singleton student = Singleton.GetInstance; student.PrintDetails("From Student"); }
static void Main(string[] args) { Singleton.GetInstance().ShowMessage(); }