// 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 Inher {
    public static void main(String[] args) {
        System.out.println(new C(123.456));
        System.out.println(new C(123, 123.456));
        System.out.println(new C("ABC", 123.456));
        System.out.println(new C(123, "ABC", 123.456));
    }
}

class P {
    private int iv;
    private String sv;
    public P() {
        this(0, "");
    }
    public P(int iv) {
        this(iv, "");
    }
    public P(String sv) {
        this(0, sv);
    }
    public P(int iv, String sv) {
        this.iv = iv;
        this.sv = sv;
    }
    @Override
    public String toString() {
        return iv + " |" + sv + "|";
    }
}

class C extends P {
    private double xv;
    public C(double xv) {
        this(0, "", xv);
    }
    public C(int iv, double xv) {
        this(iv, "", xv);
    }
    public C(String sv, double xv) {
        this(0, sv, xv);
    }
    public C(int iv, String sv, double xv) {
        super(iv, sv);
        this.xv = xv;
    }
    @Override
    public String toString() {
        return super.toString() + " " + xv;
    }
}
