import java.util.ArrayList;

/**
 * This class illustrates several uses of the static keyword.
 * 
 * @author Alyce Brady
 * @version 12 February 2016
 */
public class StaticIllustrationDriver
{
    /**
     * This main method runs the code in the Static Illustration Driver.
     */
    public static void main(String[] args)
    {
        // Invisible step:  Set up all of the static variables, objects
        
        // Construct an ArrayList, put some values in it, and step through it.
        ArrayList<Student> studentList = createStudentList();
        
        // Print the name, major, and ID for each student.
        for ( Student s : studentList )
        {
            System.out.println(s.getName() + ": " + s.getMajor() + 
                                    " (" + s.getID() + ")");
        }

    }

    private static ArrayList<Student> createStudentList()
    {
        // Construct an ArrayList, put some values in it, and step through it.
        ArrayList<Student> studentList = new ArrayList<Student>();
        studentList.add(new Student("Rey Diaz", "CS"));
        studentList.add(new Student("Hermione Granger", "CES"));
        studentList.add(new Student("Alex", "CS"));
        studentList.add(new Student("Sivhaun", "CS"));
        return studentList;
    }
}
