题目内容

public class SyncTest{ public static void main(String args) { final StringBuffer s1= new StringBuffer(); final StringBuffer s2= new StringBuffer(); new Thread () { public void run() { synchronized(s1) { s2.append(“A”); synchronized(s2) { s2.append(“B”); System.out.print(s1); System.out.print(s2); } } } }.start(); new Thread() { public void run() { synchronized(s2) { s2.append(“C”); synchronized(s1) { s1.append(“D”); System.out.print(s2); System.out.print(s1); } } } }.start(); } } Which two statements are true? ()

A. The program prints “ABBCAD”
B. The program prints “CDDACB”
C. The program prints “ADCBADBC”
D. The output is a non-deterministic point because of a possible deadlock condition.
E. The output is dependent on the threading model of the system the program is running on.

查看答案
更多问题

单体用水量

机床几何精度检查一般在()状态下进行。

A. 动态
B. 静态
C. 工作
D. 空载
E. 负载

党风廉政建设责任制规定的适用范围是哪些?

高压断路器的额定电压,一般是指()。

A. 断路器正常、长期工作的峰值电压
B. 断路器正常、长期工作的相电压
C. 断路器正常、长期工作的线电压
D. 断路器正常、长期工作的平均电压

答案查题题库