JAVA-增强for循环

增强for循环

public class rug {
    public static void main(String[] args) {
        int[] numbers = {10,20,30,40,50};   //定义一个数组
        //遍历数组的元素
        for (int x: numbers){
            System.out.println(x);
        }
    }
}
posted @ 2021-07-30 15:22  Pesson-T  阅读(47)  评论(0)    收藏  举报