예제 #1
0
파일: Program.cs 프로젝트: Habi95/CSharp
        static void Main(string[] args)
        {
            Cage <Ape>   apeCage   = new Cage <Ape>(CageType.Glass);
            Cage <Tiger> tigerCage = new Cage <Tiger>(CageType.Gitter);
            Ape          ape       = GenericObject.GenerateObject <Ape>(new object[] { "APE", "Bert", CageType.Glass });

            apeCage.AddAnimal(ape);
            Tiger tiger = GenericObject.GenerateObject <Tiger>(new object[] { "TIGER", "Luzifer", CageType.Glass });

            tigerCage.AddAnimal(tiger);
            apeCage.RemoveAnimal(ape);
        }
예제 #2
0
        static void DisplayNames()
        {
            Human   human   = new Human();
            Whale   whale   = new Whale();
            Dolphin dolphin = new Dolphin();
            SeaLion seaLion = new SeaLion();
            Ape     ape     = new Ape();


            human.GivesBirth();
            dolphin.Sound(dolphin.Name);
            ape.PlaysGames();
            whale.TypeOfEater();
            seaLion.Breathe();
        }