public Student(Person person, Education education, int group) : base() { fName = person.FirstName; lName = person.LastName; date = person.Date; this.education = education; this.group = group; }
private void btnCreatePerson_Click(object sender, EventArgs e) { tbInfo.Text = ""; pr1 = new Person(); pr2 = (Person)pr1.DeepCopy(); string equa; if (pr1.Equals(pr2)) { equa = "Объекты равны"; } else { equa = "Объекты не равны"; } string hash = "Хэш код Person 1: " + pr1.GetHashCode().ToString() + "\r\n" + "Хэш код Person 2: " + pr2.GetHashCode().ToString(); tbInfo.Text = "Person 1: " + "\r\n" + pr1.ToString() + "\r\n" + "Person 2: " + pr2.ToString() + "\r\n" + hash + "\r\n" + equa; }
public Student(Person person, Education education, int group) { this.person = person; this.education = education; this.group = group; }
public Student() { person = new Person(); education = Education.Вachelor; group = 230; }