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.
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad: