O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

There's more...

Take into account that if you use the sorted method, you have to provide Comparator that can be applied to the elements you want to sort or the elements of the stream must implement the Comparable interface. In our case, the Person class implements that interface and the compareTo() method to sort the elements of the stream according to their first and last names.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required