もし要素のない行があったらその行の最大値は嘘の値になるね
int[][] num = {
{ 10, 6, 3, 5, 1 },
{ 78, 11, 90, -4, 0 },
{ 0, -22, -3, -5, -1 },
{}
};
for (int i = 0; i < num.length; i++) {
int max = Integer.MIN_VALUE;
for (int j = 0; j < num[i].length; j++) {
if (max < num[i][j]) max = num[i][j];
}
if (num[i].length > 0) System.out.println(i + 1 + "行目の最大値 = " + max);
else System.out.println(i + 1 + "行目に要素はありません");
}