例子:t = count++;
即:{
t = count;
count = count+1;
}
例子:t = ++count;
即:{
count = count+1;
t = count;
}
下面我们来看个例子:
public class AddTest {
public static void main(String[] args) {
int num = 0;
int count = 0;
for(int i = 0;i<=3;i++) {
num = num+i;
count=count++;
}
System.out.println(num*count);
}
}
结果为:0
因为count一直未0