*二维数组的初始化

package com.chongrui.test;

/*
*二维数组的初始化
* */


public class test {

public static void main(String[] args) {

int a[][]=new int[3][4];
System.out.println("输出3行4列的数组");
for(int i=0;i<a.length;i++){
for(int j=0;j<a[i].length;j++){//遍历数组当中的每个元素,
System.out.print(a[i][j]+" ");//将数组当中每个元素输出
}
System.out.println(" ");

}


}
}

输出3行4列的数组
0 0 0 0
0 0 0 0
0 0 0 0

原文地址:https://www.cnblogs.com/tantanba/p/6288027.html