本帖最后由 Lingxin 于 2016-3-24 12:03 编辑
亲爱滴大神,多多指教!- class HelloWorld {
- public static void main(String[] args) {
- int[][] arr2 = {{3,5,7,8},{11,44,33,66,88}};
- for (int i =0;i < arr2.length ;i++ ) { //遍历二维内含几个一维
- for (int j =0;j < arr2[i].length ;j++ ) { //遍历每个一维中的元素
- System.out.print(arr2[i][j] +"\t");
- }
- System.out.println(); //给一维分别换行
- }
- }
- }
复制代码
|
|