Collections.synchronizedList vs Vector
10,393
Here are few words on why Vector is an obsolete/deprecated class: Why is Java Vector class considered obsolete or deprecated?
Generally about their difference: In java, Vector and Collections.synchronizedList are all synchronized, what's the difference?
Related videos on Youtube
Author by
Murali
Updated on July 12, 2022Comments
-
Murali almost 2 years
I would like to use collection classes for adding,removing and retrieving objects in multiple thread.
Collections.synchronizedList
andVector
both classes are thread safe. Does any tell me the difference betweenCollections.synchronizedList
andVector
and explain that when should I useVector
andCollections.synchronizedList
? -
Vishy over 10 years+1 Use Vector when you have to because you are using an old API which expects it. Otherwise use List.