java.lang.ObjectStudent
public abstract class Student
The Student class definition which manages student first name, last name, grade and credits fields.
Constructor Summary | |
---|---|
Student()
Constructor sets default values for student first name, last name, grade and credits fields. |
|
Student(java.lang.String firstName,
java.lang.String lastName,
java.lang.String grade,
int credits)
Constructor sets initial values for student first name, last name, grade and credits fields. |
Method Summary | |
---|---|
int |
getCredits()
Returns the student's credits field as an int value. |
java.lang.String |
getFirstName()
Returns the student's first name field as a String |
java.lang.String |
getGrade()
Returns the student's grade field as a String, either A, B+, B, C+, C, D+, D or F. |
java.lang.String |
getLastName()
Returns the student's last name field as a String |
abstract java.lang.String |
getTuitionString()
An abstract placeholder method for the getTuitionString()
method which assures that all subclasses of class Student must
implement this method which is called from the toString() method
of this Student class. |
void |
setCredits(int credits)
Sets value for the student's credits field which must not be negative. |
void |
setFirstName(java.lang.String firstName)
Sets value for student first name field. |
void |
setGrade(java.lang.String grade)
Sets value for student grade field which must be from the list A, B+, B, C+, C, D+, D or F. |
void |
setLastName(java.lang.String lastName)
Sets value for student last name field. |
java.lang.String |
toString()
Returns a String representation of the Student class which is the formatted first name, last name, grade and credits fields with labels and the return value of the getTuitionString() method of all its subclasses. |
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Student()
public Student(java.lang.String firstName, java.lang.String lastName, java.lang.String grade, int credits)
firstName
- the student's first namelastName
- the student's last namegrade
- the student's letter gradecredits
- the number of credits carried by the studentMethod Detail |
---|
public int getCredits()
int
value.
public java.lang.String getFirstName()
public java.lang.String getGrade()
public java.lang.String getLastName()
public abstract java.lang.String getTuitionString()
abstract
placeholder method for the getTuitionString()
method which assures that all subclasses of class Student must
implement this method which is called from the toString() method
of this Student class.
public void setCredits(int credits)
credits
- the number of credits carried by the studentpublic void setFirstName(java.lang.String firstName)
firstName
- the student's first namepublic void setGrade(java.lang.String grade)
grade
- the student's letter gradepublic void setLastName(java.lang.String lastName)
lastName
- the student's last namepublic java.lang.String toString()
toString
in class java.lang.Object