/**
 * Part of a series of Child classes.
 *  Simple example of inheritance
 *  Child3 has its own method
 *     sayValue
 *  also has all Parent methods
 *  but has replaced the Parent's getValue method
 *  with a version that uses the Parent's getValue method
 *
 * @author Mark Young (A00000000)
 */
public class Child3 extends Parent {

    /**
     * Report this child's value.
     */
    public void sayValue() {
        // this method uses my own (specialized) getValue method
        System.out.println("My value is " + this.getValue()); 
    }

    /**
     * Get my own value. Overrides getValue in Parent -- but uses that method
     * as a basis for the new value it returns.
     *
     * @return a twee interpretation of my value
     */
    public String getValue() {
        // my real value is what my Parent says it is
        String myRealValue = super.getValue();

        // but I'm a Child, so I'm a bit twee....
        String howISayIt = myRealValue.replace('r', 'w');

        return howISayIt;
    }

}

