class Program { static void Main(string[] args) { OverWriteTestTT owTT = new OverWriteTestTT(); owTT.Hello(); overWriteTestTTT owTTT = new overWriteTestTTT(); owTTT.Hello(); } } class OverWriteTest { //Over write the method ToString(); public override string ToString() { return "hello world"; } //Define a virtual method Hello() to be over written public virtual void Hello() { Console.WriteLine("hello"); } } class OverWriteTestTT : OverWriteTest { public override void Hello() { Console.WriteLine("No hello world"); } } class overWriteTestTTT : OverWriteTestTT { //Over write the method Hello() of class OverWriteTestTT public override void Hello() { base.Hello(); Console.WriteLine("NNo hello world"); } }