Here you can find the source of maxLength(List
private static int maxLength(List<String> list)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.List; public class Main { private static int maxLength(List<String> list) { int result = 0; for (String s : list) { result = Math.max(result, s.length()); }// w w w. j a v a 2 s. c o m return result; } }