Here you can find the source of max(T[] args)
public static <T extends Comparable<T>> T max(T[] args)
//package com.java2s; //License from project: Apache License public class Main { public static <T extends Comparable<T>> T max(T[] args) { if ((args == null) || (args.length == 0)) { return null; }/*from w w w . ja v a2s. c o m*/ T max = null; for (int i = 0; i < args.length; i++) { T t = args[i]; if ((max == null) && (t != null)) { max = t; } else if (max.compareTo(t) < 1) { max = t; } } return max; } }