int[] number = {10,20,30,40,50}; //遍历数组元素 for(int x:number){ System.out.println(x); } idea中arry.for自动生成循环头