JAVA JUC synchronized 锁的理解
synchronized 锁,对于非静态方法,默认为this,对于静态方法,默认为 该类的运行时类实例.
class Number { public synchronized void getOne(){ System.out.println("one"); } public synchronized void getTwo(){ System.out.println("two"); } public void getThree(){ System.out.println("three"); } }