/**
 * One of a sequence of classes extending Parent. This class replaces the
 * getValue method from Parent.
 *
 *  Child2 has its own method
 *     sayValue
 *  also has all Parent methods
 *  but has replaced the Parent's getValue method
 *  with an entirely new one of its own
 *
 * @author Mark Young (A00000000)
 */
public class Child2 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.
     *
     * @return a very babyish value
     */
    public String getValue() { 
        return "Ba-ba";
    }
}

