| Author |
HashTable Synchronized
|
Yog Ananth
Greenhorn
Joined: Dec 28, 2004
Posts: 27
|
|
|
what is the necessary for all the legacy classes synchronized, any special use for that
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16686
|
|
By legacy, I am assuming you mean JDK 1.0 container classes. Good, bad, or indifferent, JDK 1.0 container classes were synchronized to allow threadsafe access. As for why they are still synchronized, I am assuming it is to be backward compatible. Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Ed Wallen
Ranch Hand
Joined: Feb 11, 2002
Posts: 34
|
|
In general, you should use those objects provided in the new Collections API (since 1.2). If you need a collection implementation to be threadsafe, use the java.util.Collections class. Collections consists exclusively of static methods that operate on or return collections. The methods that begin with "syncronized" will return you a threadsafe collection implementation (list, set, map, etc.). -Ed
|
 |
 |
|
|
subject: HashTable Synchronized
|
|
|