namespace Inheritance { class OOPConcepts { public class Animal { private string AnimalName; private void Breath() {} public Animal(string name) { Breath(); //As soon as an animal created it starts breathing. AnimalName = name; } public virtual void MakeSound() { Console.WriteLine("This animal does not make any sound") ; } } public class Tiger : Animal { public override void MakeSound() { Console.WriteLine("Growl"); } public Tiger(string name):base( name ){} } public class Lion : Animal { public override void MakeSound() { Console.WriteLine("Roar"); } public Lion(string name):base(name){} } static void Main(string[] args) { List zoo = new List(); zoo.Add(new Tiger("Tigger")); zoo.Add(new Lion("simba")); foreach( Animal a in zoo ) { a.MakeSound(); Console.ReadLine(); } } } }