Java 8 in Action -- Errata
Here's the (May 2015) list of known errors for (the print and final PDF download version of) Java 8 in
Action.
If you find any other error, please post it to the book's Author Online Forum.
Thanks!
Chapter 2, Page 36
The final code example in Section 2.3.4 should read:
List<Integer> evenNumbers =
filter(numbers, (Integer i) -> i % 2 == 0);
Chapter 3, Page 49
In Figure 3.3 (box 4), the final declaration should read:
String twoLines = processFile((BufferedReader br) ->
br.readLine() + br.readLine());
// ^ no second parenthesis here
Chapter 5, Page 97
The bottom line should contain
List<Stream<String>>
Chapter 9, Page 217
The final line of the top example (line 7 of the page) should read:
setRotationAngle((getRotationAngle () + angleInDegrees) % 360);
Chapter 7, Page 221
First example in Section 9.4.3 should rad
public interface A {
default void hello() {
System.out.println("Hello from A");
}
}
public interface B {
default void hello() {
System.out.println("Hello from B");
}
}
public class C implements B, A { }
Chapter 10, Page 233
(Confusion between Person/People.) The text just after the first example in Section 10.3.3 should read:
"The variable optPerson is of type Optional<Person>, so it's perfectly fine to ..."
Chapter 11, Page 270
In line 3, the reference to listing 11.12 should be to listing 11.16.
Chapter 13, Page 301
In line 3 there is a missing closing parenthesis:
"Using the for-each loop in Java, for(Apple a : apples) { } decodes into ..."
That's all for now folks!
Raoul Urma, Mario Fusco, Alan Mycroft