Here you can find the source of min(final int... numbers)
public static int min(final int... numbers)
//package com.java2s; /*/* w w w . j a va 2s .c om*/ * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2007-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ public class Main { /** * @return the smallest of the given numbers */ public static int min(final int... numbers) { if (numbers.length == 0) { throw new IllegalArgumentException("at least one parameter is required"); } int min = numbers[0]; for (int i = 1; i < numbers.length; i++) { int number = numbers[i]; if (number < min) { min = number; } } return min; } }