Java tutorial
import java.util.Arrays; import java.util.List; public class Main { public static void main(String[] args) { List<String> friends = Arrays.asList("CSS", "HTML", "Oracle", "Dart"); //just sort using lambda comparator System.out.println("sort:"); friends.stream().sorted((aName, bName) -> aName.compareTo(bName)).forEach(System.out::println); } }