InterviewSolution
Saved Bookmarks
| 1. |
Can Two Objects Which Are Not Equal Have The Same Hashcode? |
|
Answer» YES, two objects, which are not equal to equals() METHOD can still return same hashCode. By the way, this is ONE of the confusing bit of equals and hashcode contract. SEE Core JAVA, Volume 1 9th Edition by Cay S. Horstmann for more details. YES, two objects, which are not equal to equals() method can still return same hashCode. By the way, this is one of the confusing bit of equals and hashcode contract. See Core Java, Volume 1 9th Edition by Cay S. Horstmann for more details. |
|