// 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) namespace IFDef { public interface IX { public void M() { Console.WriteLine("IX"); } } public class X : IX { public void M() { Console.WriteLine("X"); } } public interface IY { public void M() { Console.WriteLine("IY"); } } public class YBase : IY { } public class Y : YBase { public void M() { Console.WriteLine("Y"); } } public interface IZ { public void M() { Console.WriteLine("IZ"); } } public class ZBase : IZ { } public class Z : ZBase, IZ { public void M() { Console.WriteLine("Z"); } } public class Program { public static void Main(string[] args) { IX ox = new X(); ox.M(); IY oy = new Y(); oy.M(); IZ oz = new Z(); oz.M(); } } }