所以即时通讯诚实地卡在这里,a2 [行] [列]是错误的,但我不知道为什么。我只是想念一些近距离视线?在java中获取二维数组的错误
public class ArrayHW {
public static void main(String[] args){
int [][] a2 = {{10,20,30,40},
{50, 60, 70 , 80},
{90, 100, 110, 120}};
display2DArray();
}
public static void display2DArray() {
for (int row = 0; row < 3; row++){
for (int column = 0; column < 4; column++){
System.out.println(a2[row][column]);
}
}
}
什么错误?请不要让我们猜 - 发布完整的错误信息。 –