package laba7;

class SuperClass2 {
    private String text;

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

    public void setValue(String text) {
        this.text = text;
    }

    public int getLength() {
        return text.length();
    }

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

class SubClass2 extends SuperClass2 {
    public int number;

    public SubClass2(int number, String text) {
        super(text);
        this.number = number;
    }

    public void setValue() {
        super.setValue("");
        number = 0;
    }

    public void setValue(String text) {
        super.setValue(text);
    }

    public void setValue(int number) {
        this.number = number;
    }

    public void setValue(String text, int number) {
        super.setValue(text);
        this.number = number;
    }

    @Override
    public String toString() {
        return "SubClass2: textLength=" + getLength() + ", number=" + number;
    }
}

public class example2 {
    public static void main(String[] args) {
        SubClass2 obj = new SubClass2(10, "Hello");
        obj.setValue("World", 20);
        System.out.println(obj);
    }
}