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

问题:

[单选]

public class X implements Runnable(  
 private int x;  
private int y; 
 public static void main(Stringargs) 
X that = new X();  
(new Thread(that)).start(); 
(new Thread(that)).start(); 
) 
public void run() ( 
for (;;) ( 
x++;  
y++;  
System.out.printIn(“x=” + x + “, y = ” + y);  
)  
)  
What is the result?()  

A .  Errors at lines 7 and 8 cause compilation to fail.
B .  The program prints pairs of values for x and y that might not always be the same on the same line  (for example, “x=2, y=1”).
C .  The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by  “x=1, y=1”).
D .  The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears only for once (for example, “x=1, y=1”  followed by “x=2, y=2”).

请描述高压避雷器是如何避雷? 国家机关制作的文书作为证据使用一定是公文书证。 为了保证把分选矿石中的磁性强的矿粒和磁性弱的矿粒分开,必须满足的条件是()。 f磁强>Σf机>f磁弱。 f磁弱>Σf机>f磁强。 Σf机>f磁强>f磁弱。 Σf机>f磁弱>f磁强。 凡是知道案件情况并有作证能力的成年人才能做证人。 砂质乳脂糖起晶的机理是什么?

public class X implements Runnable(  
 private int x;  
private int y; 
 public static void main(Stringargs) 
X that = new X();  
(new Thread(that)).start(); 
(new Thread(that)).start(); 
) 
public void run() ( 
for (;;) ( 
x++;  
y++;  
System.out.printIn(“x=” + x + “, y = ” + y);  
)  
)  
What is the result?()  

参考答案:

  参考解析

本题暂无解析

在线 客服