有什么区别:
public synchronized void test(){}
和
public void test() { synchronized(Sample.class){} }
java multithreading synchronized-block
java ×1
multithreading ×1
synchronized-block ×1