// 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 abstract class AP { public virtual void M() { Console.WriteLine("AP"); } } public class C1 : AP { public override void M() { Console.WriteLine("C1"); } } public class C2 : AP { } public class Program { public static void Main(string[] args) { AP o1 = new C1(); o1.M(); AP o2 = new C2(); o2.M(); } } }