// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class P { public void M1() { Console.WriteLine("I am P M1"); } public virtual void M2() { Console.WriteLine("I am P M2"); } } public class C : P { public new void M1() { Console.WriteLine("I am C M1"); } public override void M2() { Console.WriteLine("I am C M2"); } } public class Program { public static void Main(string[] args) { P o = new C(); o.M1(); o.M2(); } } }