Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errata on chapter 7 Concurrency, in the section Working with Parallel Streams  RSS feed

 
Omar B. Cisse
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In chapter 7 Concurrency, in the section "Working with Parallel Streams", the paragraph "Combining Results with reduce()" gives the example:


Then, it is said that the variable c is interpreted as a char but the signature of the three argument reduce() method is:

So c is not a Char in the above example. c is a String. Checking the code in eclipse shows the type of c when scrolling over the variable with the mouse (check attached file).

The correct way to write this is to change the order between c and s1 and also instead of c+s1 it is s1+c :


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36634
475
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. This was originally reported here and listed on page 374 of the errata. I realize it is hard to find things in the errata if reading the book at safaribooks so no worries on the duplicate reports!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!