Here you can find the source of maxLength(T[] array)
public static <T extends CharSequence> int maxLength(T[] array)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static int maxLength(Collection<? extends CharSequence> coll) { int re = 0; if (null != coll) for (CharSequence s : coll) if (null != s) re = Math.max(re, s.length()); return re; }//from w w w.j a v a2 s . c om public static <T extends CharSequence> int maxLength(T[] array) { int re = 0; if (null != array) for (CharSequence s : array) if (null != s) re = Math.max(re, s.length()); return re; } }