// 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 Funky {
    public static void main(String[] args) {
        P op = new P();
        op.getIC().m();
        P oc = new C();
        oc.getIC().m();
        op.mcall(oc.getIC());
        oc.mcall(op.getIC());
    }
}

class P {
    public static class IC {
        public void m() {
            System.out.println("P.IC.m");
        }
    }
    public void mcall(IC ic) {
        ic.m();
    }
    public IC getIC() {
        return new IC();
    }
}

class C extends P {
    public static class IC extends P.IC {
        public void m() {
            System.out.println("C.IC.m");
        }
    }
    public void mcall(IC ic) {
        ic.m();
    }
    public IC getIC() {
        return new IC();
    }
}
