Here you can find the source of max(T... elems)
static <T extends Comparable<? super T>> T max(T... elems)
//package com.java2s; //License from project: Open Source License public class Main { static <T extends Comparable<? super T>> T max(T... elems) { if (elems.length == 0) return null; T best = elems[0];/*w w w . jav a 2s. c om*/ for (T t : elems) { if (t.compareTo(best) > 0) { best = t; } } return best; } }