You are on page 1of 1

class Test { int x = 0; public static int y = 0; public Test() { x++; y++; } public int get_x() { return x; } }

class Program { static void Main(string[] args) { Test a, b, c; a = new Test(); Console.WriteLine("x = {0}, y = {1}", a.get_x(), Test.y); b = new Test(); Console.WriteLine("x = {0}, y = {1}", b.get_x(), Test.y); c = new Test(); Console.WriteLine("x = {0}, y = {1}", c.get_x(), Test.y); Console.ReadKey(); } }

You might also like