Пример #1
0
        public static void Main()
        {
            First f1 = new First();
            First f2 = new First();
            First f3 = new First();

            Console.WriteLine(f1.x + " " + f2.x + " " + f3.x + " ");
            Second g1 = new Second(100);// here the value 100 is firstly passed to the local variable x then passed to the class variable x
            Second g2 = new Second(200);
            Second g3 = new Second(300);

            Console.WriteLine(g1.x + " " + g2.x + " " + g3.x + " ");
            Console.ReadLine();
        }
Пример #2
0
        static void Main()
        {
            First f1 = new First();
            First f2 = new First();
            First f3 = new First();

            Console.WriteLine(f1.x + " " + f2.x + " " + f3.x);

            Second s1 = new Second(100);
            Second s2 = new Second(200);
            Second s3 = new Second(300);

            Console.WriteLine(s1.x + " " + s2.x + " " + s3.x);

            Console.ReadLine();
        }