using System.Collections.Generic;
public int Age {get;set;}
abstract class Mammal : Animal
public abstract void FeedWithMilk();
abstract class Insect : Animal
public bool HasWings {get; set;}
class Wolf : Mammal, ICarnivore
public override void FeedWithMilk()
Console.WriteLine("Wolf's nipples");
Console.WriteLine("Wolf chews meet");
class Cow : Mammal, IHerbivore
public override void FeedWithMilk()
Console.WriteLine("Cow's nipples");
Console.WriteLine("Cow chews grass");
class Butterfly : Insect, IHerbivore
Console.WriteLine("Butterfly chews grass");
class Dragonfly : Insect, ICarnivore
Console.WriteLine("Dragonfly chews meet");
class Hedgehog : Animal, IHerbivore, ICarnivore
Console.WriteLine("Hedgehog chews grass");
Console.WriteLine("Hedgehog chews meet");
public static void Main(object [] prms)
var animals = new List<Animal>
foreach(var animal in animals)
ICarnivore carnivore = (ICarnivore)animal;