The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

229646 (4) [Avatar] Offline
Hi smilie

On page 41 it's written:
Comparator<Apple> byWeight =
(Apple a1, Apple a2) -> a1.getWeight().compareTo(a2.getWeight());

and on page 42:
(Apple a1, Apple a2) -> a1.getWeight().compareTo(a2.getWeight())

The fifth lambda expression has two parameters of
type Apple and returns an int: the comparison of
the weight of the two Apples.

So what does it return exactly?