java For 循环 运行顺序
运行结果:
a
b
i love java
c
b
i love java
c
b
i love java
c
b
i love java
c
结论:先运行赋值语句i--->条件判断--->执行下面语句--->改变数值i--->条件判断...........循环 直到条件不满足
另一种for循环
public class One {
public static void main(String args[]){
String[] runnoobs = new String[3];
runnoobs[0] = "one";
runnoobs[1] = "two";
runnoobs[2] = "three";
for(String i:runnoobs){
System.out.println(i+"\n");
}
}
}