·foreach输出
public class test {
public static void main(String[] args) {
int data [] = new int[] {1,4,3,3,2,2,3};
for(int temp : data) {
//自动循环,将data的每一个内容交给temp
System.out.println(temp);
}
int data_2 [][] = new int[][] {{1,4,3,3},{2,2,3}};
for(int temp[] : data_2) {
for(int temp_2 : temp) {
System.out.print(temp_2 + "、");
}
System.out.println();
}
}
}