Here you can find the source of max(int... array)
public static int max(int... array)
//package com.java2s; //License from project: Open Source License public class Main { public static int max(int... array) { if (array.length == 0) throw new ArrayIndexOutOfBoundsException(); int max = Integer.MAX_VALUE; for (int i : array) { if (i > max) max = i;/* w w w .ja v a 2 s . c om*/ } return max; } public static long max(long... array) { if (array.length == 0) throw new ArrayIndexOutOfBoundsException(); long max = Long.MAX_VALUE; for (long l : array) { if (l > max) max = l; } return max; } public static float max(float... array) { if (array.length == 0) throw new ArrayIndexOutOfBoundsException(); float max = Float.MAX_VALUE; for (float f : array) { if (f > max) max = f; } return max; } public static double max(double... array) { if (array.length == 0) throw new ArrayIndexOutOfBoundsException(); double max = Double.MAX_VALUE; for (double d : array) { if (d > max) max = d; } return max; } }