Java List Max maxStringLength(List strings)

Here you can find the source of maxStringLength(List strings)

Description

max String Length

License

Apache License

Declaration

public static int maxStringLength(List<String> strings) 

Method Source Code

//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;
    }
}

Related

  1. maxInt(List array)
  2. maxLength(List patterns)
  3. maxLength(List list)
  4. maxLength(List strings)
  5. maxList(Iterable iterable)