static void Main() { //List<Animal> animals = new List<Animal> Animal[] animals = new Animal[] { new Cat("Alex", 2, Sex.female), new Dog("Bruno",3, Sex.male), new Frog("Bro",4, Sex.male), new Tomcat("Tom", 2), new Kitten("Kitty", 5) }; Console.WriteLine(animals.Average(a => a.Age)); }
public override void ProduceSound(Animal newCat) { Console.WriteLine("Bau"); }
public abstract void ProduceSound(Animal typeAnimal);