java - Why was hashcode designed to return int -


this question has answer here:

it seems hashcode returns int. appears limiting factor due intmax. 1 can argue such never have many objects, cause heap overflow etc. if chose double instead of int guarantee larger extent hashcode wont unique distinct objects ?

hashcodes don't need unique. that's why hashcodes. use in hashing algorithms. don't need unique keys.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -