• Post Reply Bookmark Topic Watch Topic
  • New Topic

collection-synchronizeList  RSS feed

 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
If i need synchonize List then which one is better, vector or Collection.synchonizeList(new ArrayList) and why.
Thanks and Regards,
kundan
 
Nishant Verma
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kundan

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

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

Cheers
 
Campbell Ritchie
Marshal
Posts: 56209
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont see any difference
There isn't a lot of difference but nowadays most people would use an synchronized ArrayList.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!