In Appendix question answers, referring to Chapter 7, Question 10, for the following code:
System.out.println(Arrays.asList("duck", "chicken", "flamingo", "pelican").parallelStream().parallel() // q1
.reduce(0, (c1, c2) -> c1.length() + c2.length(),
(s1, s2) -> s1 + s2)); // q3
In the answers, answers say: The problem here is that
c1 is a String but c2 is an int, so the code fails to combine on line q2, since calling length() on an int is not allowed, and C is correct.
I think it should be the other way round; c1 is an int (in fact an Integer?) and c2 is a String?