下面的鎖是不一樣的。static,是相當於鎖類;二非static是鎖類的一個實例,即this.
public static synchronized void abc(int threadNo) { 19 for (int i = 1; i < 10000; i++) { 20 21 System.out.println("No." + threadNo + ":" + i); 22 } 23 }
http://blog.csdn.net/yangzhijun_cau/article/details/6432216