foreach循环案例教程
public class Test{ public static void main(String args[]){ int data[] = new int[] {1,2,3,4,5,6}; for(int x : data){//每一次循环将数组的内容赋值给变量x; System.out.print(x+" "); } } }