code: public static double max(double[][] matrix) {
          double m = Double.NEGATIVE_INFINITY;
  
          for (double[] x : matrix) {
              for (double y : x) {
                  if (m < y) {
                      m = y;
                  }
              }
          }
  
          return m;
      }
docs: Returns the maximum of a matrix.