Пример #1
0
        static void Main(string[] args)
        {
            Animal aCat = new Cat() { Name = "Erik", Age = 2 };
            Animal aDog = new Dog() { Name = "Bråhammar", Age = 8 };

            var d = new Dog() { Name = "Merethe", Age = 8 };

            Console.WriteLine(  aDog.ToString());
            Console.WriteLine(d.ToString());
            //aCat.PrintInfo();
            //aDog.PrintInfo();

            ////aCat.PrintInfoTest(); // Error
            //Cat cat = (Cat)aCat;
            //cat.PrintInfoTest();

            //Console.WriteLine("-------------------------------");

            //Console.WriteLine(aCat.ToString());
            //Console.WriteLine(aDog.ToString());
            //Console.WriteLine(cat.ToString());

            //Console.WriteLine("-------------------------------");

            //aCat.PrintTheShit();
            //cat.PrintTheShit();
        }