// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
public class DefaultPolymorh {
    public static void main(String[] args) {
        I1 o1 = new C();
        o1.m();
        I2 o2 = new C();
        o2.m();
        C o3 = new C();
        o3.m();
    }
}

interface I1 {
    public default void m() {
        System.out.println("I1.m");
    }
}

interface I2 extends I1 {
    public default void m() {
        System.out.println("I2.m");
    }
}

class C implements I2 {
    public void m() {
        System.out.println("C.m");
    }
}
