public static void CovariantOverridesInAction() { Animal animal = new Lion(); Console.WriteLine("Hello World! Animal food tastes " + animal.GetFood().Taste()); // Should print "Hello world! Animal food tastes meaty" }
static void Main(string[] args) { Animal lion = new Lion(); PrintAnimal(lion); Console.WriteLine(); Animal seal = new Seal(); PrintAnimal(seal); Console.WriteLine(); Animal bear = new Bear(); PrintAnimal(bear); }