Here you can find the source of max(double[] array)
public static double max(double[] array)
//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; } }