Java Collection Max max(Collection collection)

Here you can find the source of max(Collection collection)

Description

max

License

Open Source License

Declaration

public static int max(Collection<Integer> collection) 

Method Source Code


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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Main {
    public static int max(Collection<Integer> collection) {
        List<Integer> list = new ArrayList<Integer>(collection);
        Collections.sort(list);//from  w  ww  .  j  a  v  a  2  s. com
        return list.get(list.size() - 1);
    }
}

Related

  1. getMaximumElementLength(final Collection collection)
  2. max(Collection coll)
  3. max(Collection data)
  4. max(Collection doubles)
  5. max(Collection values)
  6. max(Collection list)
  7. max(Collection strs)
  8. max(Collection col)
  9. max(Collection elems)