下面程序结果为:( )
class WhileTests {
public static void main(String[] args) {
int x = 5;
while (++x < 6) {
--x;
}
System.out.println("x=" + x);
}
}x=6
x=5
死循环
编译失败
++在前,先加1再比较
下面程序结果为:( )
class WhileTests {
public static void main(String[] args) {
int x = 5;
while (++x < 6) {
--x;
}
System.out.println("x=" + x);
}
}x=6
x=5
死循环
编译失败