0
What is hashcode and equals method
Difference
1 Answer
0
hashCode() converts an object to a near-unique int number as its identifier, but it is not 100% unique.
equals() compares two objects if they are the same. It should be 100% the same (by selected criteria).
in HashMap if two (or more) object has the same hashCode then the equals method is used by searching between these two objects