一、 数组的初始化
String[][] str = new String[5][];
int[][] scores = new int[][] { { 90, 85, 54 }, { 76, 80 },{ 87 } };
int[][]scores = { { 90, 85, 54 },{ 76, 80 },{ 87 } };
一、
Public class Case5 { // 二维数组的遍历
Public static void main(String[] args) {
int[][] scores = new int[][] { { 90, 78, 54 }, { 76 , 80 }, { 87 } };
for (inti = 0; i<scores.length; i++) { //外层数组长度
for (intj = 0; j<scores[i].length; j++) {//内层数组长度
System.out.println(scores[i][j]);
}
}
}
}