package laba7;

class Base {
    private String text;

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

    public void show() {
        System.out.println("Base: " + text);
    }

    protected String getText() {
        return text;
    }
}

class ChildInt extends Base {
    protected int number;

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

    @Override
    public void show() {
        System.out.println("ChildInt: " + getText() + ", " + number);
    }
}

class ChildChar extends Base {
    protected char symbol;

    public ChildChar(String text, char symbol) {
        super(text);
        this.symbol = symbol;
    }

    @Override
    public void show() {
        System.out.println("ChildChar: " + getText() + ", " + symbol);
    }
}

public class example5 {
    public static void main(String[] args) {
        Base a = new Base("Base");
        Base b = new ChildInt("Int", 10);
        Base c = new ChildChar("Char", 'Z');

        a.show();
        b.show();
        c.show();
    }
}