Here you can find the source of getMax(List
Parameter | Description |
---|---|
d | array list |
public static double getMax(List<Double> d)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**/* w w w . ja v a2 s .co m*/ * Returns the maximum value of an Arraylist with doubles * * @param d * array list * @return maxima */ public static double getMax(List<Double> d) { double res = -Double.MAX_VALUE; for (Double db : d) { if (db > res) res = db; } return res; } /** * Returns the maximum value of an Arraylist with doubles * * @param d * array list * @return maxima */ public static double getMax(double[] d) { double res = -Double.MAX_VALUE; for (Double db : d) { if (db > res) res = db; } return res; } }