Here you can find the source of max(T first, T... others)
@SafeVarargs public static <T extends Comparable<T>> T max(T first, T... others)
//package com.java2s; //License from project: Apache License public class Main { @SafeVarargs public static <T extends Comparable<T>> T max(T first, T... others) { T result = first;/*from w w w.ja v a 2 s . c o m*/ for (T value : others) { if (value.compareTo(result) > 0) { result = value; } } return result; } }