package laba7;

class SuperClass1 {
    private String text;

    public SuperClass1(String text) {
        this.text = text;
    }

    @Override
    public String toString() {
        return "SuperClass1: text=" + text;
    }
}

class SubClass1 extends SuperClass1 {
    private String extraText;

    public SubClass1(String text) {
        super(text);
        this.extraText = "";
    }

    public SubClass1(String text, String extraText) {
        super(text);
        this.extraText = extraText;
    }

    @Override
    public String toString() {
        return "SubClass1: " + super.toString() + ", extraText=" + extraText;
    }
}

public class example1 {
    public static void main(String[] args) {
        SuperClass1 a = new SuperClass1("Base");
        SubClass1 b = new SubClass1("Base", "Child");

        System.out.println(a);
        System.out.println(b);
    }
}