增强for循环
作者:互联网
增强for循环
package base.struct;
public class ForDemo5 {
public static void main(String[] args) {
//定义了一个数组
int[] numbers={10,20,30,40,50};
for (int i=0;i<5;i++){
System.out.println(numbers[i]);
}
System.out.println("==================");
//遍历数组的元素
//增强for循环
for (int x:numbers){
System.out.println(x);
}
}
}
标签:增强,int,System,循环,numbers,println,public,out 来源: https://www.cnblogs.com/zenyangderensheng/p/16267732.html