Ejemplo n.º 1
0
        static void Main()
        {
            StaticDemo obj = new StaticDemo();

            obj.sub(); // non -static method
            obj.Sum(); //instance
            Console.WriteLine(obj.a);
            Console.WriteLine(b);
            div();//static method
            Console.WriteLine();
        }
Ejemplo n.º 2
0
        static void Main()
        {
            Console.WriteLine("static Demo 2");
            StaticDemo.div();
            StaticDemo obj = new StaticDemo();

            obj.sub();
            obj.Sum();
            int c = obj.a;
            int a = StaticDemo.b;

            Console.ReadLine();
        }