java流程控制之 高级for循环


package struct;

public class Demo09 {
    public static void main(String[] args) {
        text();
    }

    public static void text() {
        int[] nums = {10, 20, 30, 40, 50,65,65,656565,656};

        for (int i = 0; i < nums.length; i++) {
            System.out.print(nums[i]+"\t");//10	20	30	40	50	65	65	656565	656
        }
        System.out.println();
        System.out.println("=================");


        for (int x : nums) {
            System.out.print(x+"\t");//10	20	30	40	50	65	65	656565	656
        }
    }
}

posted @ 2021-07-29 09:55  阿向向  阅读(67)  评论(0编辑  收藏  举报