Java ArrayList Max maxLengthSurface(ArrayList value)

Here you can find the source of maxLengthSurface(ArrayList value)

Description

max Length Surface

License

Apache License

Declaration

private static String maxLengthSurface(ArrayList<String> value) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

public class Main {
    private static String maxLengthSurface(ArrayList<String> value) {
        String maxSurface = value.get(0);
        int maxSurfaceLength = value.get(0).length();
        for (String compound : value) {
            if (compound.length() > maxSurfaceLength) {
                maxSurface = compound;//from   w w w.  j  a va  2s . co m
                maxSurfaceLength = compound.length();
            }
        }
        return maxSurface;
    }
}

Related

  1. Max(ArrayList values)
  2. maxEltsInOneSetOfValues(ArrayList values)
  3. maxInColumns(ArrayList lines)
  4. maxIntValue(ArrayList ints)
  5. maxLength(ArrayList> a)
  6. maxset(ArrayList a)