This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Core Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Core Java" Watch "Core Java" New topic

Core Java

vijay bomma

Joined: Feb 18, 2007
Posts: 2
What is hascCode() ?

how it is used in real-time scenario ?

--- vijay
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
I think that you mean HashCode

HashCodes are usually used to increase the performance of large collections of data. The Hashcode is used for searching into the right subset of the data.

HashCode is used by the following collections, HashSet, HashMap.

Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63544

vijay bomma, please take the time to choose an appropriate forum for your posts. This forum is for questions on HTML and Javascript. This post has been mvoed to a more approriate forum.

[Asking smart questions] [About Bear] [Books by Bear]
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Take a look at the JavaDoc for Object.hashCode(). It explains, beyond the nice summary that Wilhelm provided, details about the hashCOde() method.
subject: Core Java
It's not a secret anymore!