예제 #1
0
        static void Main(string[] args)
        {
            Cage <Animal> cage   = new Cage <Animal>();
            Monkey        monkey = new Monkey("Klaus");

            cage.AddAnimal(monkey);
            Tiger tiger = new Tiger("Mickey");

            cage.AddAnimal(tiger);
            cage.RemoveAnimal(tiger);
            cage.showAnimalsInCage();
        }
예제 #2
0
파일: Program.cs 프로젝트: smo1982/Cage
        static void Main(string[] args)
        {
            Monkey        monkey     = new Monkey("Aff");
            Tiger         tiger      = new Tiger("katz");
            Cage <Monkey> monkeyCage = new Cage <Monkey>();

            monkeyCage.AddAnimal(monkey);
            Cage <Tiger> tigerCage = new Cage <Tiger>();

            tigerCage.AddAnimal(tiger);
            monkeyCage.PrintAnimal();
            tigerCage.PrintAnimal();
            monkeyCage.RemoveAnimal(monkey);
            monkeyCage.PrintAnimal();
            tigerCage.PrintAnimal();
            Console.ReadKey();
        }