Here you can find the source of maxStringLength(List
public static int maxStringLength(List<String> strings)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static int maxStringLength(List<String> strings) { int l = 0; for (String s : strings) l = Math.max(l, s.length()); return l; }//from w w w.j a v a 2 s . c o m public static double max(double[] list) { double m = Double.NEGATIVE_INFINITY; for (double x : list) m = Math.max(m, x); return m; } public static double max(double[][] mat) { double m = Double.NEGATIVE_INFINITY; for (double[] list : mat) for (double x : list) m = Math.max(m, x); return m; } public static int max(int[] list) { int m = Integer.MIN_VALUE; for (int x : list) m = Math.max(m, x); return m; } }