Campbell Ritchie wrote:There isn't a “following class”. There are two classes. Assuming the line about dates (No 17) shouldn't be there, and assuming there is no Bear class, I found four compile‑time errors
Line 10 does not compile because the override reduces the visibility of an inherited method, with the package-private modifier being more restrictive than the protected modifier. Line 11 does also not compile, since the left-hand side of a compound assignment operator must be used with a variable, not a method. Finally, Line 12 does not compile because super.grunt() is inherited as an abstract method in the PolarBear class, meaning the parent class has no implementation. For these three reasons, Option D is the correct answer.
Charles O'Leary wrote:The online experience does not appear to be under the authors' control. I try to stick strictly to each book and its respective errata for the best experience.
...you can assume a question’ s code block will compile and run if “Does not compile” and “Throw an exception at runtime” are not available in the list of answers.