Here you can find the source of getMaxValue(ArrayList
public static double getMaxValue(ArrayList<Double> values)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static double getMaxValue(ArrayList<Double> values) { if (values.isEmpty()) { return -1.0; }//from w ww . jav a 2 s. c o m double max = -1.0; for (Double value : values) { if (max < value) { max = value; } } return max; } }