Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java max array

public static double max(double[] arr) {
  double result = arr[0];
  for (int i = 1; i < arr.length; ++i) {
    if (result < arr[i]) result = arr[i];
  }
  return result;
}
 
PREVIOUS NEXT
Tagged: #java #max #array
ADD COMMENT
Topic
Name
1+2 =