【发布时间】:2015-02-07 22:29:02
【问题描述】:
如果您尝试在列中显示二维数组并且遇到超出范围的异常,那么解决该问题的最佳方法是什么?你会抛出异常吗?先感谢您!
/*print out the array contents going down the columns from the first column to the last*/
for (int col=0;col<stuff.length; col++) {
for (int row=0;row<stuff[col].length;row++) {
System.out.print(stuff[row][col]); System.out.print(" ");
}
System.out.println();
}
【问题讨论】:
-
“我试图将我的代码作为图像发布”你为什么要这样做?为什么不直接将其发布为文本?
标签: java arrays multidimensional-array