July 2019
Intermediate to advanced
536 pages
12h 57m
English
We can sort a stream by calling the sort() function. Let's use the sort() function on the languages list, as shown in the following code:
languages.stream().sorted();
This will sort the elements in alphabetical order. We can provide a lambda expression to sort the elements using custom comparison logic.
Read now
Unlock full access