// 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 PolyOrNotPoly {
    public static void test(A o) {
        o.m1();
        o.m2();
    }
    public static void main(String[] args) {
        test(new B());
    }
}

class A {
    public void m1() {
        System.out.println("A.m1");
    }
    public static void m2() {
        System.out.println("A.m2");
    }
}

class B extends A {
    public void m1() {
        System.out.println("B.m1");
    }
    public static void m2() {
        System.out.println("B.m2");
    }
}
