第2题 (10分)
以下代码中,哪个synchronized使用方式锁定的是类对象?
public class Test {
public void method1() {
synchronized(this) { /* A */ }
}
public synchronized void method2() { /* B */ }
public static synchronized void method3() { /* C */ }
public void method4() {
synchronized(new Object()) { /* D */ }
}
}