Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between synchronized list and vector

 
Pavan Rao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one tell me difference between synchronized list and vector
 
varungupta ggg
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Syncronized ArrayList and vector both are syncronized. But probably parformance of ArrayList is better than vector.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15437
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vvv ggg - please check your private messages for an administrative matter from JavaRanch.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is helpful...

http://skeletoncoder.blogspot.com/2006/09/java-tutorials-arraylist-or-vector.html
 
Campbell Ritchie
Sheriff
Pie
Posts: 49764
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper Young wrote:vvv ggg - please check your private messages for an administrative matter from JavaRanch.
Same again, please.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic