This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes Use of Hash Code in Java apart from Collection Framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Use of Hash Code in Java apart from Collection Framework" Watch "Use of Hash Code in Java apart from Collection Framework" New topic
Author

Use of Hash Code in Java apart from Collection Framework

Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

Hi All,

I want to know use of hash code in Java other than Collection Framework.
I googled many websites but they are using collection framework so want to know that any other use of hash code in Java without collection framework.


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Ramesh Pramuditha Rathnayake
Ranch Hand

Joined: Oct 31, 2012
Posts: 169
    
    1

Maps are used in Jasper Reporting using java. Normally HashMap. Parameters to the report are send using a Map.


Ramesh-X
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38517
    
  23
The CRC, SHA and similar calculations are similar to hash codes. They are used to confirm the integrity of downloads and to confirm passwords.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14117
    
  16

The hashCode() method in class Object really only exists to support hash-based collections such as HashMap and HashSet.

The hashes that Campbell mentions (CRC, SHA etc.) are not related to the hashCode() method of class Object. Those are cryptographic hash functions, and even though they also have the word "hash" in their name they're used for other purposes and have other requirements than what hashCode() normally is used for.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

Thanks Campbell and Jesper
 
 
subject: Use of Hash Code in Java apart from Collection Framework