📜  java代码示例中的数组查找最大值

📅  最后修改于: 2022-03-11 14:52:31.993000             🧑  作者: Mango

代码示例3
public static double max(double[] arr) {
  double result = Double.NEGATIVE_INFINITY;
  for (int i = 0; i < arr.length; ++i) {
    if (result < arr[i]) result = arr[i];
  }
  return result;
}