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

问题:

[单选]

What will be the result of attempting to compile and run the following program?()  
public class Q28fd {  
public static void main(String args[]) {  
int counter = 0;  
l1:  
for (int i=10; i<0; i--) {  
l2:  int j = 0;  
while (j < 10) { 
 if (j > i) break l2;  
if (i == j) {  
counter++;  
continue l1;  
}  
}  
counter--;  
}  
System.out.println(counter); 
}  
} 

A . The program will fail to compile.
B . The program will not terminate normally.
C . The program will write 10 to the standard output.
D . The program will write 0 to the standard output.
E . The program will write 9 to the standard output.

绝对湿度 电话交换的基本任务是按主叫用户的要求连通被叫用户进行通话,并在话终时拆断连接。 下列哪一项不是个人储蓄的动机() 投资动机。 积累动机。 增值动机。 谨防动机。 在下列价格弹性的表达中,正确的是() 需求量变动对价格变动的反应程度。 价格变动的绝对值对需求量变动的绝对值的影响。 价格的变动量除以需求的变动量。 需求的变动量除以价格的变动量。 《魔笛》的剧情复杂,混合了许多因素,其中不包括() 魔法。 打油诗。 西方神话。 宗教色彩。

What will be the result of attempting to compile and run the following program?()  
public class Q28fd {  
public static void main(String args[]) {  
int counter = 0;  
l1:  
for (int i=10; i<0; i--) {  
l2:  int j = 0;  
while (j < 10) { 
 if (j > i) break l2;  
if (i == j) {  
counter++;  
continue l1;  
}  
}  
counter--;  
}  
System.out.println(counter); 
}  
} 

参考答案:

  参考解析

本题暂无解析

在线 客服