Hashcode of primitive types

A

Alex Hunsley

TT said:
convert to java.lang.Integer, java.lang.Double or java.lang.Float and call
the hash member function.

For Integer, you may as well just the use the value of the int itself. I
can't see any reason for any other mapping to be any better than this,
and it's what Integer.hashCode() does anyway...

alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

hashCode 95
hashCode 50
Wrapping primitive types in arrays 13
hashCode() for Custom classes 24
Eclipse generated hashCode() and Compiler Efficiency 4
hashcode 5
Maximum identity hashcode? 46
hashCode and equals (again) 19

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top