package day02;
public class ForTwoArray {
public static void main(String[] args) {
//二维数组循环遍历
int[][] arr = {{1, 2, 3}, {4, 5}, {6, 7, 8, 9}};
ForArray(arr);
}
public static void ForArray(int[][] arr) {
for (int i = 0; i < arr.length; i++) {//arr.length是统计二维数组中有几个一维数组
for (int j = 0; j < arr[i].length; j++) {//arr[i].length是统计每个一维数组的长度
System.out.println(arr[i][j]);
}
}
}
}