Collections class has synchronized methods
Collections class has synchronized methods like synchronizedCollection,synchronizedSet,synchronizedList and so on that return a synchronized collection.
a) What is a synchronized collection that is returned here? What does it mean its synchronized when we still have to use #b below?
b) The collection returned by the above methods must again be accessed synchronously within a synchronized block, Does using Vector avoid this?
Please advice.
Thanks
Deepak
> a) What is a synchronized collection that is returned
> here?
What? Those methods returns a wrapper that is synchronized. The wrapper delegates the calls to the original collection (but does so from synchronized methods)
> What does it mean its synchronized when we
> still have to use #b below?
Why do you have to use b? Who says that?
> b) The collection returned by the above methods must
> again be accessed synchronously within a synchronized
> block,
Who says so?
> Does using Vector avoid this?
No
kajbja at 2007-7-12 20:59:11 >
