主要用来便利数组和集合
public class EnhanceForLoop {
public static void main(String[] args) {
int[] numbers=new int[]{1,2,3,4,5};
for(int i:numbers){
System.out.println(i);
}
}
}
输出:
1
2
3
4
5
主要用来便利数组和集合
public class EnhanceForLoop {
public static void main(String[] args) {
int[] numbers=new int[]{1,2,3,4,5};
for(int i:numbers){
System.out.println(i);
}
}
}
输出:
1
2
3
4
5