当前位置:SCJP程序员认证考试题库

问题:

[多选]

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线对地绝缘电阻?(用小型测量台以WX1键为例、校表)() 断开局内设备,拔掉保安单元。 将表放平、调零,红表笔插入“+”插孔,黑表笔插入“-”插孔。 选择档位为“Ω”档,选择量程为R×1K档,进行校表。 扳外线1和接表两键,此时表针所指刻度乘以100,即为a线对地绝缘电阻。 堆肥法是利用自然界广泛分布的细菌、()菌和()菌等微生物,人为地促进可生物降解的有机物向稳定的()生化转化的微生物学过程。 20世纪六、七十年代,行政学摆脱了长期以来对政治科学的过分依赖,由应用研究转向纯理论研究。

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? ()

参考答案:

  参考解析

本题暂无解析

在线 客服