//******************************************************************** // Student.java Author: Lewis and Loftus // // Represents a student. //******************************************************************** class Student { protected String name; protected int numCourses; //----------------------------------------------------------------- // Sets up a student with the specified name and number of // courses. //----------------------------------------------------------------- public Student (String name, int numCourses) { this.name = name; this.numCourses = numCourses; } //----------------------------------------------------------------- // Returns information about this student as a string. //----------------------------------------------------------------- public String toString () { String result = "Student name: " + name + "\n"; result += "Number of courses: " + numCourses; return result; } }