Author
difference between synchronized list and vector
Pavan Rao
Greenhorn
Joined: Apr 11, 2008
Posts: 9
can any one tell me difference between synchronized list and vector
varungupta ggg
Greenhorn
Joined: Jun 03, 2008
Posts: 1
posted Aug 12, 2009 06:14:24
0
Hi Raja
Difference between Vector and List is
Vector are Thread Safe It means Only one Thread can accec Vector SO it can Hit the Performance.
Whereas List are not Thread Safe so as many thread acess the same at same time.
So High Performance is achived.
So If need to understand our requirement Whther er need thred safe and non thred safe model to store our objects.
shivendra tripathi
Ranch Hand
Joined: Aug 26, 2008
Posts: 263
Syncronized ArrayList and vector both are syncronized. But probably parformance of ArrayList is better than vector.
SCJP 1.5(97%) My Blog
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
vvv ggg - please check your private messages for an administrative matter from JavaRanch.
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
sdg raja wrote: can any one tell me difference between synchronized list and vector
Vector implements the List interface, so Vector is a synchronized List.
shivendra tripathi wrote: Syncronized
ArrayList and vector both are syncronized. But probably parformance of
ArrayList is better than vector.
On what do you base that ? Both Vector and ArrayList are backed by arrays, so i would expect performance to be pretty similar. But I would be happy to be corrected on this if you have any figures to support your statement.
Joanne
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
This is helpful...
http://skeletoncoder.blogspot.com/2006/09/java-tutorials-arraylist-or-vector.html
JDBCSupport - An easy to use, light-weight JDBC framework -
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
Jesper Young wrote: vvv ggg - please check your
private messages for an administrative matter from JavaRanch.
Same again, please.
subject: difference between synchronized list and vector