//: containers/Synchronization.java // ©2015 MindView LLC: see Copyright.txt // 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<>()); } } ///:~