- 线程不安全类
- StringBuilder -> StringBuffer
- SimpleDateFormat -> JodaTime
- 同步容器
- ArrayList -> Vector,Stack
- HashMap -> HashTable(key, value不能为null)
- Collections.synchronizedXXX(List, Set, Map)
- 并发容器
- ArrayList -> CopyOnWriteArrayList
- HashSet,TreeSet -> CopyOnWriteArraySet,ConcurrentSkipListSet
- HashMap,TreeMap -> ConcurrentHashMap,ConcurrentSkipListMap
1 | //可以自行进行测试 |