package JavaLinkedListDemo; public class Professor { /** professor's last name */ private String strLastName ; /** professor's first name */ private String strFirstName ; /** professor's e-mail address */ private String strEmailAddress ; /** professor's specialty */ private String strSpecialty ; /** default constructor. * This constructor calls the four-parameter constructor with four empty string values. */ public Professor() { this( "", "", "", "" ) ; // call 4-parameter constructor with defaults } /** two-parameter constructor. * This constructor calls the four-parameter constructor with empty string values for the * third and fourth parameters (the professor's e-mail address and specialty). * @param strLastName professor's last name * @param strFirstName professor's first name */ public Professor( String strLastName, String strFirstName ) { // call 4-parameter constructor with defaults for third and fourth parameters this( strLastName, strFirstName, "", "" ) ; } /** four-parameter constructor. * This is the standard constructor for a Professor object * @param strLastName professor's last name * @param strFirstName professor's first name * @param strEmailAddress professor's e-mail address * @param strSpecialty professor's specialty */ public Professor( String strLastName, String strFirstName, String strEmailAddress, String strSpecialty ) { this.strLastName = strLastName ; // save data passed in parameters this.strFirstName = strFirstName ; this.strEmailAddress = strEmailAddress ; this.strSpecialty = strSpecialty ; } /** String representation of a Professor object * @return components of a Professor object within square brackets */ public String toString() { return "[ " + strLastName + ", " + strFirstName + ", " + strEmailAddress + ", " + strSpecialty + " ]" ; } }