非静态
synchronized 方法 等于synchronized(this)
静态
synchronized(类名.class)
线程安全的类StringBuffer Hashtable 多线程的时候用这两个 血和泪的教训!
补充
Hashtable 基本被
List<String> list= Collections.synchronizedList(new ArrayList<String>());替代了
原文:https://www.cnblogs.com/joenSu/p/15158466.html