Here you can find the source of minInt(Collection
Parameter | Description |
---|---|
ints | a parameter |
public static int minInt(Collection<Integer> ints)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 pf_miles./*from w w w .j a v a 2 s . co m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * pf_miles - initial API and implementation ******************************************************************************/ import java.util.Collection; public class Main { /** * find the min integer * * @param ints * @return */ public static int minInt(Collection<Integer> ints) { int ret = Integer.MAX_VALUE; for (int i : ints) if (i < ret) ret = i; return ret; } }