It's not a secret anymore!
The moose likes Beginning Java and the fly likes About Hash Map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About Hash Map " Watch "About Hash Map " New topic

About Hash Map

Raj chiru
Ranch Hand

Joined: Aug 12, 2008
Posts: 142
Is it preferable to store large amount of data in Hash map?and what's disadvantage of hash map?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10771

"Large amounts" is a relative term. How do you define it?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45429
Have a look at this Java™ Tutorials section.
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
A HashMap is only as good as it's hashing algorithm. For instance a HashMap that throws everything into 1 bucket is equally as useless as a HashMap which throws everything into it's own bucket. The short answer to your question would be "yes", a HashMap or any of the HashXXX objects are designed to divide and conquer large sets of data. If you need other features such as index then a different collection would be needed.

Hope that helps somewhat... if not, please give more details.

~Currently preparing for SCJP6
I agree. Here's the link:
subject: About Hash Map
It's not a secret anymore!