Question: Q 3 ( 1 0 ) : Let's say we would like to override equals ( ) method of a Student class. Two students are

Q3(10): Let's say we would like to override equals() method of a Student class. Two students are considered equal if they have same last name and date of birth. Would it be ok to override the hashCode() method such that it returns an integer using:
a. Student ID only
b. Student Last Name + birthdate
c. Student birthdate only
Please briefly explain each part and provide your reasoning?
Q 3 ( 1 0 ) : Let's say we would like to override

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!