Here you can find the source of min(int value1, int value2, int... values)
public static int min(int value1, int value2, int... values)
//package com.java2s; /*/*from w ww .ja v a 2 s .c o m*/ * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ public class Main { public static int min(int value1, int value2, int... values) { int min = Math.min(value1, value2); for (int value : values) { if (min > value) { min = value; } } return min; } public static long min(long value1, long value2, long... values) { long min = Math.min(value1, value2); for (long value : values) { if (min > value) { min = value; } } return min; } public static float min(float value1, float value2, float... values) { float min = Math.min(value1, value2); for (float value : values) { if (min > value) { min = value; } } return min; } public static double min(double value1, double value2, double... values) { double min = Math.min(value1, value2); for (double value : values) { if (min > value) { min = value; } } return min; } }