File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Soft Skills this week in the Jobs Discussion 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: 802

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: 175
    
    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: 40052
    
  28
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: 14430
    
  23

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 8 API documentation
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 802

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