Hashcodes can be used in various algorithms and data structures, in particular hash tables.
If you create a class, you should always make sure that the hashCode and equals methods make sense for that class. Joshua Bloch wrote a chapter in his book Effective Java that goes into wonderful detail about this. The chapter is available on this site somewhere as a pdf. Try googling for it, maybe with a search like this:
joshua bloch effective java hashcode filetype:pdf site:java.sun.com
Everyone should learn about the filetype: and site: search modifiers on Google. They're wonderful.
Ah, here it is:
http://java.sun.com/developer/Books/effectivejava/Chapter3.pdf