Answers for "how to get the min and max from the array in java"

0

java max array

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;
}
Posted by: Guest on February-05-2021

Code answers related to "how to get the min and max from the array in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language