Here you can find the source of min(Collection
Parameter | Description |
---|---|
a | the collection of integers |
public static int min(Collection<Integer> a)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**//w w w. ja va 2 s .c om * Find the smallest integer in a collection. * * @param a * the collection of integers * @return the smallest integer in a. */ public static int min(Collection<Integer> a) { int i = Integer.MAX_VALUE; for (int z : a) i = Math.min(z, i); return i; } public static int min(Collection<Collection<Integer>> d, Object e) { int i = Integer.MAX_VALUE; for (Collection<Integer> g : d) i = Math.min(i, min(g)); return i; } }