// 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) 
public class IFDef {
    public static interface IX
    {
        public default void m() {
            System.out.println("IX");
        }
    }
    public static class X implements IX {
        public void m() {
            System.out.println("X");
        }
    }
    public static interface IY
    {
        public default void m() {
            System.out.println("IY");
        }
    }
    public static class YBase implements IY {
    }
    public static class Y extends YBase {
        public void m() {
            System.out.println("Y");
        }
    }
    public static interface IZ
    {
        public default void m() {
            System.out.println("IZ");
        }
    }
    public static class ZBase implements IZ {
    }
    public static class Z extends ZBase implements IZ {
        public void m() {
            System.out.println("Z");
        }
    }
    public static void main(String[] args) {
        IX ox = new X();
        ox.m();
        IY oy = new Y();
        oy.m();
        IZ oz = new Z();
        oz.m();
    }
}
