用Collections.synchronizedCollection创建线程安全的集合、列表。。。

 Collection c=Collections.synchronizedCollection(new ArrayList());
 List list=Collections.synchronizedList(new ArrayList());
 Set s=Collections.synchronizedSet(new HashSet());
 Map m=Collections.synchronizedMap(new HashMap());

原文地址:https://www.cnblogs.com/tianSky/p/6078333.html