java中二维数组求最大值代码。。。。。。不懂呀

总结:二维数组理解不了,,,,求解析。。。

package com.c2;

public class Aaa {

	// 求数组元素中最大的

	public static void main(String[] args) {
		int a[][] = { { 1, 3, 4 }, { 2, 1, 5 }, { 6, 3, 2 } };
		int max = a[0][0];

		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a.length; j++) {
				if (a[i][j] > max) {
					max = a[i][j];
				}
			}
		}

		System.out.println("" + max);
	}

}

  

原文地址:https://www.cnblogs.com/langlove/p/3390255.html