When programmer using the vector and arrylist? and when ur using linkedlist and hashmap and hashtable?

Pls ans me

Showing Answers 1 - 6 of 6 Answers

cool

  • Nov 14th, 2005
 

when u want programmes to run in multithreading environment then use concept of vector because it is synchronized.But arraylist is not synchronized so, avoid use of arraylist in multithreading enviornment.

  Was this answer useful?  Yes

Prashanth

  • Nov 14th, 2005
 

ArrayList is not Synchronized. Hence in multithreaded programming use ArrayList While Vector is Synchronized. So if we have a Banking ATM transaction where u dont want 2 people to access the same account at the same time in 2 different m/c use Vector.

  Was this answer useful?  Yes

Chandrahaas

  • Nov 17th, 2005
 

Hi,

Plz kindly give the answer for this question.

Regards

Chandrahasa.

  Was this answer useful?  Yes

SJ

  • Dec 18th, 2005
 

Both Vector and ArrayList are implemented using Arrays and both are collections whose data can be accessed by using an index. Both are essentially the same except that a Vector is synchronized and an ArrayList is not.

  Was this answer useful?  Yes

siva kumar reddy

  • Aug 10th, 2006
 

hi,

these all collection objects are used to store the objects.

arraylist is used to random access.linked list is maintains the order.but these are not thread safe.

vector is a synchronised.it is used in multithreading concepts.arraylist performs better than the vector.these three are allows duplicate values.

hashmap does permits the null values.hashtable doesn't.

hashtable is synchronised.hashmap is not synchronised.

hashmap does n't maintains the order.default hashtable also does not maintains order but when we used  enemuration it will possible.

if any correction send to my mail sivaa345@yahoo.co.in

cheers gals and guys

siva

  Was this answer useful?  Yes

Muthuramakrishnan.K

  • Dec 8th, 2006
 

Sometimes, we may not know until run time precisely how large of an array we need. At that situation, the collections framework defines arrayList.ArrayList is a variable length array of object references & dynamically increase or decrease in size.

Vector is synchronized, and it contains many legacy methods that are not part of the collections framework.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions