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