public class Student
extends L5.Person
Constructor and Description |
---|
Student()
Creates a Student with name "undefined", Date of Birth of Jan 01, 1980, and an empty list of courses
|
Student(L5.Person p)
Creates a student from a "deep" copy of the person, with an empty list of courses
|
Student(java.lang.String name,
java.util.Date dob)
Creates a student with a name born on a specific date with an empty list of courses
|
Student(java.lang.String name,
java.util.Date dob,
java.util.List<java.lang.String> courses)
Creates a student with name, date of birth and a list of courses
|
Student(Student s)
Creates a "deep" copy of the student
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCourse(java.lang.String course)
Adds a course to the list of courses
|
java.util.List<java.lang.String> |
getCourseList()
Returns the list of courses for the student
|
boolean |
removeCourse(java.lang.String course)
Removes a course from the list of courses
|
java.lang.String |
toString()
Prints the student's name, date of birth, and the list of courses, line by line
|
public Student()
public Student(java.lang.String name, java.util.Date dob)
name
- namedob
- date of birthpublic Student(java.lang.String name, java.util.Date dob, java.util.List<java.lang.String> courses)
name
- namedob
- date of birthcourses
- Courses in which the student is registeredpublic Student(L5.Person p)
p
- existing personpublic Student(Student s)
s
- existing studentpublic boolean addCourse(java.lang.String course)
course
- Course to be addedpublic boolean removeCourse(java.lang.String course)
course
- Course to be removedpublic java.util.List<java.lang.String> getCourseList()
public java.lang.String toString()
toString
in class L5.Person