Java Array Max Value max(double[] array)

Here you can find the source of max(double[] array)

Description

max

License

Open Source License

Declaration

public static double max(double[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double max(double[] array) {
        if (array.length == 0)
            throw new IllegalArgumentException("length cannot be 0.");
        double maxElement = Double.NEGATIVE_INFINITY;
        for (double d : array) {
            if (d > maxElement)
                maxElement = d;//from w w w.  j a  va  2 s.  c  o  m
        }
        return maxElement;
    }
}

Related

  1. max(double... values)
  2. max(double... values)
  3. max(double... values)
  4. max(double[] a)
  5. max(double[] arr)
  6. max(double[] array)
  7. max(double[] array)
  8. max(double[] array)
  9. max(double[] array)