Exemplo n.º 1
0
        public static void LuyenTap_DaHinh()
        {
            Animal cat = new Cat();

            cat.NhapThongTin("Nhap thong tin cho Meo:");
            cat.XuatThongTin();
            cat.Speak();
            cat.Run();
            cat.An();

            Console.WriteLine("So luong animal hien tai la {0} ", Animal.Count);

            Animal dog = new Dog();

            dog.NhapThongTin("Nhap thong tin cho Cho:");
            dog.XuatThongTin();
            dog.Speak();
            dog.Run();
            dog.An();

            Console.WriteLine("So luong animal hien tai la {0} ", Animal.Count);

            Animal chicken = new Chicken();

            chicken.NhapThongTin("Nhap thong tin cho Ga:");
            chicken.XuatThongTin();
            chicken.Speak();
            chicken.Run();
            chicken.An();

            Console.WriteLine("So luong animal hien tai la {0} ", Animal.Count);
        }