public static SingletonDemo getInstance() { if (instance == null) { instance = new SingletonDemo(); } return(instance); }
static void Main(string[] args) { //SingletonDemo gotInstance = SingletonDemo.getInstance(); SingletonDemo singletonDemo = new SingletonDemo(); MyDeligate myDeligate = new MyDeligate(singletonDemo.Sumation); int res = myDeligate(2, 3); Console.WriteLine(res.ToString()); }