I need help with enums. I don't get them. This is part of a larger assignment, so all I need to do is fix this. I'm trying to assign year levels of school to constants.
public class Student extends Person
{
public Student( String name, String address, String phone,
String email, String grade )
{
super( name, address, phone, email);
}
public enum Year
{
FIRST( "Freshmen"),
SECOND("Sophmore"),
THIRD("Junior"),
FOURTH("Senior");
public final String gradeLevel;
Year( String grade )
{
gradeLevel = grade;
}
public String getGradeLevel()
{
return gradeLevel;
}
}
public String toString()
{
return String.format( "%s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n%s: %s\n\n" ,
"Student Object",
"Name", getFullName(),
"Address" , getHomeAddress(),
"Phone #" , getPhoneNumber(),
"E-mail Address" , getEmailAddress(),
"Grade Level" );
}
}