Here you can find the source of min(int... xs)
public static int min(int... xs)
//package com.java2s; //License from project: Open Source License public class Main { public static int min(int... xs) { if (xs.length == 0) throw new RuntimeException("ArrayHelper.min cannot be used on an empty array."); int v = Integer.MAX_VALUE; for (int x : xs) if (x < v) v = x;//from w w w .j a v a 2s . co m return v; } public static double min(double... xs) { if (xs.length == 0) throw new RuntimeException("ArrayHelper.min cannot be used on an empty array."); double v = Double.MAX_VALUE; for (double x : xs) if (x < v) v = x; return v; } }