这里是我的Java代码:预计这个循环是无限的,但它不是
public class Prog1 {
public static void main(String[] args) {
int x = 5;
while (x > 1) {
x = x + 1;
if (x < 3)
System.out.println("small x");
}
}
}
这是输出:
small x
我期待一个无限循环..任何想法为什么这样表现?
是这是一个家庭作业的问题....谢谢.... – hari 2011-05-23 16:46:24