for循环定义数组
作者:互联网
1 package com.xl.struct; 2 3 public class ForDemo05 { 4 public static void main(String[] args) { 5 int[] numbers = {10,20,30,40,50};//定义了一个数组 6 for (int i= 0;i<5;i++){ 7 System.out.println(numbers[i]); 8 } 9 System.out.println("==========="); 10 11 //遍历数组的元素 12 for (int x:numbers){ 13 System.out.println(x); 14 } 15 } 16 }
标签:ForDemo05,定义,xl,int,循环,数组,public 来源: https://www.cnblogs.com/x5253/p/15938033.html