单选题:当编译并运行下列程序段时,运行结果是什么?
当编译并运行下列程序段时,运行结果是什么?
public class Test {
public static void main(String[ ] args) {
int i=0;
while (i--<0){
System.out.println("The value of i is "+i);
}
System.out.println("The end");
}
}
@[C](2)
A. 编译时错误
B. 运行时错误
C. The end
D. The value of i is 0
A.编译时错误
B.运行时错误
C.The end
D.The value of i is 0
答案:C
public class Test {
public static void main(String[ ] args) {
int i=0;
while (i--<0){
System.out.println("The value of i is "+i);
}
System.out.println("The end");
}
}
@[C](2)
A. 编译时错误
B. 运行时错误
C. The end
D. The value of i is 0
A.编译时错误
B.运行时错误
C.The end
D.The value of i is 0
答案:C