예제 #1
0
        public static SingletonDemo getInstance()
        {
            if (instance == null)
            {
                instance = new SingletonDemo();
            }


            return(instance);
        }
예제 #2
0
        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());
        }