/**
 * Part of a series of Child classes.
 *
 *  Child5 has all Parent methods
 *  also has own method sayValue
 *  and its own instance variable
 *  also has its own constructor
 *      which uses Parent's constructor
 *      before setting its own fields
 *
 * @author Mark Young (A00000000)
 */
public class Child5 extends Parent2 {
    
    // my own private field
    private int num;

    /**
     * Create this child with value and number.
     *
     * @param reqValue the requested value (in Parent)
     * @param reqNum the requested number (in this class)
     */
    public Child5(String reqValue, int reqNum) {
        // create my Parent2 part using the String value I was given
        super(reqValue);

        // initialize own fields down here
        num = reqNum;
    }

    /**
     * Report this child's value.
     */
    public void sayValue() { 
        // I have a getValue method!  I inherited it.
        System.out.println("My value is " + this.getValue());
    }

    /**
     * Return this child's number
     *
     * @return this Child's number
     */
    public int getNum() {
        return num;
    }

    /**
     * Change this Child's number
     *
     * @param newNum the new number for this child
     */
    public void setNum(int newNum) {
        num = newNum;
    }

}

