int[][] matrix; /* 异常情况:null [] [[]] ** 否则matrix[0]会出现空指针的错误 */ if (matrix == null || matrix.length == 0) { return false; } if (matrix[0] == null || matrix[0].length == 0) { return false; } int m = matrix.length; int n = matrix[0].length;