+ 3

what is the hashing code ??

14th Aug 2016, 2:06 PM
Kamdem Dhalson
Kamdem Dhalson - avatar
3 Respostas
+ 1
Hashcode is a number generated using hash function. Every object has its own hashcode. This helps to store/retrieve objects quickly in/from hashtable. See more hashing concept here https://www.cs.cmu.edu/~adamchik/15-121/lectures/Hashing/hashing.html
14th Aug 2016, 6:36 PM
WPimpong
WPimpong - avatar
+ 1
In addition, when implementing equals method, the hadhCode method must be implemented, too as it is used by HashMap and HashSet. Implementing hashCode speeds the process. When retrieving an element from HashMap object, the hashCode method is called for the key. Keys with the same hash code are stored together in a list or bucket..and once the key found, the equals method is called to check the right key. Finally the value that the key points retrieved
14th Aug 2016, 7:24 PM
Tiger
Tiger - avatar
0
thank you very much ... i'm understant now
14th Aug 2016, 7:45 PM
Kamdem Dhalson
Kamdem Dhalson - avatar