Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get the max value of an array java

public static double arrayMax(double[] arr) {
    double max = Double.NEGATIVE_INFINITY;

    for(double cur: arr)
        max = Math.max(max, cur);

    return max;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #max #array #java
ADD COMMENT
Topic
Name
9+6 =