Hi,
In the javadocs regarding many of the java.util classes, it states
that the classes are not synchronized, and suggest using the
Collections.syn chronizedX(...) methods for getting synchronized
objects. However, why couldn't one simply declare:
private synchronized LinkedList l;
and have the variable be automatically synchronized, instead of having
private List l = Collections.syn chronizedList(n ew LinkedList());
Thanks for any help,
Frank
In the javadocs regarding many of the java.util classes, it states
that the classes are not synchronized, and suggest using the
Collections.syn chronizedX(...) methods for getting synchronized
objects. However, why couldn't one simply declare:
private synchronized LinkedList l;
and have the variable be automatically synchronized, instead of having
private List l = Collections.syn chronizedList(n ew LinkedList());
Thanks for any help,
Frank
Comment