Could somebody show me a quick example how to sort an ArrayList alphabetically in Java 8 using the new lambda syntax.
ArrayList
Suppose you have List of names(String) which you want to sort alphabetically.
List result = names.stream().sorted( Comparator.comparing(n->n.toString())).collect(Collectors.toList());
its working perfectly.