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(); }
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(); }