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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.244.228