增强for循环

package struct;

public class ForDemo05 {
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(int x:numbers){
System.out.println(x);
}
}
}
posted @ 2021-08-25 17:00  AAA编程  阅读(22)  评论(0)    收藏  举报