File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes hashcode() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "hashcode()" Watch "hashcode()" New topic


Naveen R R

Joined: May 04, 2001
Posts: 20
Could someone provide me with an example of hashcode()? I need to get the hashcode for each attribute, sum them and rehash them.
And, how does the equals() fit in here?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
Every Java class has a hashCode() method - just call it for the String containing your attribute. Look at the source code for java.lang.String for an example.

author of:
I agree. Here's the link:
subject: hashcode()
Similar Threads
equlas() and hashCode()
What is hashCode?
Hashcode for HashMap not dependent on the hashcode of key added?
need help with the space-time continium