public override bool Equals(System.Object otherCourse) { if (!(otherCourse is Course)) { return(false); } else { Course newCourse = (Course)otherCourse; bool idEquality = this.GetId() == newCourse.GetId(); bool courseNameEquality = this.GetCourseName() == newCourse.GetCourseName(); bool courseNoEquality = this.GetCourseNo() == newCourse.GetCourseNo(); return(idEquality && courseNameEquality && courseNoEquality); } }