Skip to content

Instantly share code, notes, and snippets.

Last active July 3, 2016 11:57
What would you like to do?
List<String> strings = Arrays.asList("Joey", "Ben","Sandra","Glen");
Collections.sort(strings, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.length() < s2.length() ? 1 : -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment