// A simplified superclass (class TextView in the file TextView.java).

// Each object of the class has a simple setText method that allows

// a String to be stored in the object.

public class TextView extends View {

    // the text to be displayed

    private String mText;

    public void setText(String text) {

        mText = text;

    }

}

// A simplified subclass (class EditText in the file EditText.java).

// Each object of this class has a more elaborate setText method

// that allows a String to be edited as well as stored.

public class EditText extends TextView {

 

    @Override

    public void setText(String text) {

        // Call the original setText method inherited from class TextView.

        super.setText(text);

        // Additional instructions to allow the text to be edited go here.

    }

}