Created
March 19, 2016 09:38
-
-
Save orekyuu/4e57ca56c9849a0f20d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import java.util.ArrayList; | |
import java.util.Comparator; | |
public class Main { | |
public static void main(String[] args) { | |
ArrayList<String> strings = new ArrayList<>(); | |
String result = strings.stream() | |
.max(Comparator.comparing(String::length)) | |
.get(); | |
System.out.println(result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment