public class Zx { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
a();
}
public static void a(){
int b=1;
for(int c=0;c<10;c++)
b=c++;
System.out.println(b);
}
}
为什么修改成c<9的时候和c<10 输出是一样的?而c<其他的数输出却改变
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
a();
}
public static void a(){
int b=1;
for(int c=0;c<10;c++)
b=c++;
System.out.println(b);
}
}
为什么修改成c<9的时候和c<10 输出是一样的?而c<其他的数输出却改变
所以c的步进是2,
所以9和10是一样的结果,7和8也是一样的结果...