Java Collection Max max(Collection list)

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

Description

max

License

Apache License

Declaration

public static Number max(Collection<Number> list) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    public static Number max(Collection<Number> list) {
        Number max = list.iterator().next();
        for (Number item : list) {
            if (item.floatValue() > max.floatValue()) {
                max = item;/*from  www.j  ava  2 s.co m*/
            }
        }
        return max;
    }
}

Related

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