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 core java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "core java" Watch "core java" New topic
Author

core java

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
when we r using Vector and HashMap in real time
?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
This forum (JavaRanch) is for Questions, suggestions and whining about this site. Use the other forums to ask questions about Java.

I'm moving this thread to Java in General - beginner.


"I'm not back." - Bill Harding, Twister
Sainath Veepuri
Ranch Hand

Joined: Sep 25, 2003
Posts: 49
Hi,
It's a fact that Vector and HashMap fall under the collections frame work in java.
HashMap would be useful when we would like to keep a track over the objects which are being added to it.HashMap follows a key-value pair combination.HashMap is not thread safe (not synchronized). Hence the performance should be faster.

Vector is heavily synchronized, hence this should be slower, but then it's thread safe.

In context to the vector and hashmap, unless I need a key-value pair combination and performance to be faster, I would use a HashMap.
Else I would use a Vector if I'am not worried about performance, but to have it thread safe.
Hope this should give you some idea..
Thanks,
Sai.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: core java