/** Encapsulate information relating to a single student. ** @author: Jonathan Doughty **/ public class StudentGroup { public static void main(String[] args) { if ((args.length == 0) || (args.length % 2) != 0) { System.out.println("usage java StudentGroup [student names]"); } else { StudentGroup.makeSomeStudents(args); } } public static void makeSomeStudents(String[] arguments) { CSStudent aStudent; int nextId = 0; for (int arg = 0; arg < arguments.length; arg++) { // Each time through the loop a new CSStudent object is // created and its reference is assigned to the aStudent // field. String name = arguments[arg]; String id = String.valueOf(nextId); nextId++; aStudent = new CSStudent( name, id); aStudent.setGrade(100); // Ask each Student to identify itself System.out.println(aStudent); } // Question: Do any of the CSStudent objects created still // exist? } }