Java List Max getMax(List list)

Here you can find the source of getMax(List list)

Description

get Max

License

Open Source License

Declaration

public static Integer getMax(List<Integer> list) 

Method Source Code


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

import java.util.List;

public class Main {
    public static Integer getMax(List<Integer> list) {
        if (list == null) {
            throw new IllegalArgumentException("Empty list not allowed");
        }/* w w  w. j  a v  a  2 s. c om*/

        Integer max = Integer.MAX_VALUE;

        for (Integer number : list) {
            max = Math.max(number, max);
        }

        return max;
    }
}

Related

  1. getMax(List numList)
  2. getMax(List aList)
  3. getMax(List d)
  4. getMax(List list)
  5. getMax(List numbers)
  6. getMaxColumnSizes(List resultSet)
  7. getMaxGYS(List values)
  8. getMaxId(List ids)
  9. getMaximums(List data)