• Post Reply Bookmark Topic Watch Topic
  • New Topic

vector and arraylist  RSS feed

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the need of Syncrhonizing Arraylist.. whn we have an option of Vector
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I dont see any purpose in synchronizing arraylist.
If you want a synchronized data structure you may very well
use vector.

Arrays are equivalent to Vector except for the fact that
it is not synchronized.

If at all if arraylist is synchronzied it is mismanagement of arraylist.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not completely true. You can synchronize an ArrayList by sending it to the Collections.synchronizedList() method. And I remember other Ranchers encouraging us to do this, rather than using Vector. While I don't know the exact reasons for this, it has been discussed here and in the beginner forum on quite a few occassions. Perhaps you should usethe search tool to find the previous discussions about differences between Vector and ArrayList.

HTH

Layne
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!