java控制流程控制10增强For循环

package com.Leo.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-06-09 17:03  Leoyuan  阅读(46)  评论(0编辑  收藏  举报