File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About Hash Map " Watch "About Hash Map " New topic
Author

About Hash Map

Raj chiru
Ranch Hand

Joined: Aug 12, 2008
Posts: 141
Hi....
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: 10491
    
    9

"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
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
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.

SCJA
~Currently preparing for SCJP6
 
Consider Paul's rocket mass heater.
 
subject: About Hash Map