public static void Main()
Mammal marrah = new Cat();
Console.WriteLine("What does the cat say?");
Mammal jaredLeto = new Dog();
Console.WriteLine("What does the dog say?");
jaredLeto.SaySomething();
Mammal bruceSpringsteen = new Fox();
Console.WriteLine("What does the fox say?");
bruceSpringsteen.SaySomething();
Mammal[] mammalArray = { marrah, jaredLeto, bruceSpringsteen };
foreach (Mammal mam in mammalArray){
public virtual void SaySomething()
Console.WriteLine("Breathing noises!");
public override void SaySomething()
Console.WriteLine("Meow!");
public override void SaySomething()
Console.WriteLine("Woof!");
public override void SaySomething()
Console.WriteLine("Nya, nya, nya, nya, nya, nay!");