// 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 OOPFun {
    public static void main(String[] args) {
        C1 o1 = new C1(123, "ABC");
        System.out.println(o1.getI() + " " + o1.getS());
        C2 o2 = new C2(123, 456.789);
        System.out.println(o2.getI() + " " + o2.getX());
    }
}

class P {
    private int i;
    public P(int i) {
        super();
        this.i = i;
    }
    public int getI() {
        return i;
    }
}

class C1 extends P {
    private String s;
    public C1(int a, String s) {
        super(a);
        this.s = s;
    }
    public String getS() {
        return s;
    }
}

class C2 extends P {
    private double x;
    public C2(int a, double x) {
        super(a);
        this.x = x;
    }
    public double getX() {
        return x;
    }
}
