整形越界,死循环,产生莫名其妙的问题

public static void main(String[] args) throws Exception {
int i = 1;
boolean flag = false;
while (!flag) {
if(i == 0){
System.out.println("child thread xxxx:"+(i));
i=i+1;
}else {
i=i+1;
}
}
}

一直输出 :child thread xxxx .. 血的教训啊。

猜你喜欢

转载自www.cnblogs.com/qiumingcheng/p/9953913.html