package study5ran2yl.study; public class ForDemo02 { public static void main(String[] args) { int[] number={1,2,3,4,5}; //java定义了一个数组 for (int i = 0; i < 5; i++) { System.out.print(number[i]); } System.out.println(); System.out.println("============="); //for增强,遍历数组元素,程序员偷懒必备 for(int x:number){ System.out.print(x); } } }