import java.util.Scanner;
import csci2341.Utilities;

/*
 * A program to demonstrate inheritance using Parent and Child classes.
 *
 * @author Mark Young (A00000000)
 */
public class TestChildren2 {

    public static void main(String[] args) {

        // introduce yourself
        System.out.println("This program is a variation on TestChildren.");
        System.out.println("In this program the parent class is Parent2, "
                + "and it sets its value in the constructor.");
        Utilities.pause();

        // Parent with constructor
        Parent2 p = new Parent2("Frank");
        System.out.println("Parent's value is: " + p.getValue());
        Utilities.pause();

        // about calling a parental constructor
        System.out.println("All of the child class objects in this program "
                + "call super(_) in their constructor,\n"
                + "to initialize their value.");
        Utilities.pause();

        // Child with constructor
        Child4 c4 = new Child4("Fred");
        c4.sayValue();
        Utilities.pause();

        // Child with extra field
        Child5 c5 = new Child5("Harold", 21);
        c5.sayValue();
        Utilities.pause();
    }

}

