Forums Register Login

collection-synchronizeList

+Pie Number of slices to send: Send
Hi All,
If i need synchonize List then which one is better, vector or Collection.synchonizeList(new ArrayList) and why.
Thanks and Regards,
kundan
+Pie Number of slices to send: Send
Kundan

Truly, I dont see any difference. synchronized arraylist = vector.

Though not 100% sure. Let see if someone thinks otherwise.

Cheers
+Pie Number of slices to send: Send
 

I dont see any difference

There isn't a lot of difference but nowadays most people would use an synchronized ArrayList.
+Pie Number of slices to send: Send
Vector is all but deprecated. Nobody uses it anymore unless they are being a rebel

This goes for Hashtable and other collections created at that time. Basically there is rarely a need for a pre-synchronized collection. Its rare that you have multiple threads that only wish to add or remove something from a collection. Typically they do something else even if very slight. So the synchronization on those collections is typically wasted.
[ June 26, 2006: Message edited by: Mr. C Lamont Gilbert ]
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 664 times.
Similar Threads
New Collections Exam
Which reference is better:- Class or interface?
convert collections to string
Related to Collection class
diff between Arraylist and vector
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:44:28.