改进代码
改进代码
最终遍历代码
package com.itheima;
public class shuzu06 {
public static void main(String[] args) {
int[][] arr={{1,2,3},{4,5,6},{7,8,9}};
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
System.out.print(arr[i][j]+" ");
}
System.out.println();
}
}
}
执行结果
1 2 3
4 5 6
7 8 9
Process finished with exit code 0
标签:arr,遍历,JAVA,int,System,二维,public,out
From: https://www.cnblogs.com/cy-xt/p/16834333.html