//: containers/Synchronization.java // Using the Collections.synchronized methods. import java.util.*; public class Synchronization { public static void main(String[] args) { Collection c = Collections.synchronizedCollection( new ArrayList()); List list = Collections.synchronizedList( new ArrayList()); Set s = Collections.synchronizedSet( new HashSet()); Set ss = Collections.synchronizedSortedSet( new TreeSet()); Map m = Collections.synchronizedMap( new HashMap()); Map sm = Collections.synchronizedSortedMap( new TreeMap()); } } ///:~