Case1
public class InteviewTest04 {
public static void main(String[] args) {
int count = 0;
for (int i = 0; i < 10; i++) {
count = count++;
}
System.out.print(count); // 结果为0
}
}
结果为0
Case2
public static void main(String[] args) {
int count = 0;
for (int i = 0; i < 10; i++) {
count = ++count;
}
System.out.print(count); //结果为10,
}
标签:count,10,自增,Java,int,++,循环,public
From: https://www.cnblogs.com/bigorang/p/17958920