Small typos I've noticed in Chapter 2 (ebook version)
page 60, in the middle:
"The following is a rewrite of our program to use the Predicate class" -> interface
----------------------------------
page 91, in the middle of the last paragraph:
"...as long as it implements the Food interface" -> extends the Food class
//*** Some other points of interest ***
pages 28 & 35, various places
This one is about certain static features allowed in member and local inner classes. The expression 'static final fields' seems too broad as anything instantiated, computed or evaluated at run time still would flag a compiler error:
Probably should change the wording to "compile-time constants and constant expressions" although it may present another problem as not every reader will recall at once that while
String literals are compile-time constants, primitive wrappers are not, so the whole point of this change is likely to go unnoticed…
----------------------------------
page 49, last paragraph before the code example:
"An interface may extend another interface, and in doing so it inherits all of the abstract methods" -> replacing 'abstract' with 'non-static' would account for
default methods, as well, to remind the reader that unlike classes,
static methods in interfaces are uninheritable and a non-
static interface method is permitted to overrride a superinterface's
static method. Then again, who would remember such subtleties…
----------------------------------
pages 52 & 53
I wonder just how pedantic can be the exam when asking us what makes an interface functional. "A single abstract method per functional interface" is a good practical rule but, unfortunately, there are edge cases when it isn't true. For example, a sole abstract method that has its public twin in
java.lang.Object won't make the interface functional; consequently, an interface with such a method can declare another abstract method (just like
java.util.Comparator does with
compareTo() and
equals()) and still be functional:
----------------------------------
page 64, number 3 at the bottom of the page:
"The compiler will not allow casts to unrelated types." -> except when the LHS is an interface type
----------------------------------
page 77: in the middle of the last paragraph
"Furthermore, the first line of any constructor is a call to a parent constructor with the
super() command" -> unless the constructor itself calls its overloaded namesake or includes a call to
super().