public override bool Equals(System.Object otherStudent) { if (!(otherStudent is Student)) { return(false); } else { Student newStudent = (Student)otherStudent; bool studentIdEquality = (this.GetId() == newStudent.GetId()); bool nameEquality = (this.GetName() == newStudent.GetName()); bool enrollmentEquality = (this.GetEnrollment() == newStudent.GetEnrollment()); return(studentIdEquality && nameEquality && enrollmentEquality); } }
public override bool Equals(Object otherStudent) { if (!(otherStudent is Student)) { return(false); } else { Student newStudent = (Student)otherStudent; bool idEquality = (this._id == newStudent.GetId()); bool nameEquality = (this._name == newStudent.GetName()); bool enrollmentEquality = (this._enrollment == newStudent.GetEnrollment()); return(idEquality && nameEquality && enrollmentEquality); } }