Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Student
- {
- private string name;
- private int age;
- public Student(string name, int age)
- {
- this.name = name;
- this.age = age;
- }
- public override bool Equals(object obj)
- {
- Student other = obj as Student;
- return this.name == other.name && this.age == other.age;
- }
- public override int GetHashCode()
- {
- return this.name.GetHashCode() ^ this.age.GetHashCode();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement