【发布时间】:2016-03-15 03:32:40
【问题描述】:
所以,我想出一个函数来返回存储在二维数组中的最大值时遇到了麻烦。我知道我需要一个 for 循环来遍历 2d 数组,但我很迷茫
class maximum {
public static void main(String[] args) {
int[][] table = { {3, 9, 6, 12},
{23, -25, 54},
{0, -12, 27, 8, 16} };
System.out.println(getMax(table)); //prints 54
}
static int getMax(int[][] A){
}
}
【问题讨论】:
标签: java arrays for-loop multidimensional-array