class Program { static void Main(string[] args) { Program2 p2 = new Program2(); p2.show(); p2 = new Program3(); p2.show(); Console.Read(); } } public class Program2 { public virtual void show() { Console.WriteLine("Program2"); } } public class Program3 :Program2 { public new void show() { Console.WriteLine("Program3"); } }
new
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)