Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #max #array
ADD COMMENT
Topic
Name
5+8 =