Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Rune Thode

+ Follow
since Jan 07, 2021
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rune Thode

Alright that makes sense. I have been very satisfied with the online version, I just wanted to point out the errors, I found.

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

The code in the book:

The code in the online test:

The explanation for the the answer is the same in both versions:

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.

So the differences are:
  • Line 2: bear instead of Bear
  • Line 3: protected in sing instead of protected int sing;
  • Line 13.5: There is only one return statement (there are two in the book).

  • 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.

    I thought you were also working on the online version. I did just notice that there are two return statements in the book version, which is not mentioned in the answer.
    The version I have is this one
    The error messages are not very helpful...

    I forgot about the "datatype" in. In the book, it is correctly an int and the Bear class is called Bear, which then results in the error that grunt() cannot be overloaded with a stricter access modifier.
    Some errors have sneaked into question 79 of the online mock OCA test.

    As can be seen on the image, the Bear class names do not match. The class itself is with lower case 'b', where it is with upper case in the child class.
    Then there is a date line that shouldn't be there at all. Both errors are not in the book.
    In the online version there are two print statements: one in the do-while body and one outside. With the one in the body, none of the possible answers are possible.
    There is a typo in the answer explanation in the online version. It says "Line m3 attempts to reference the third element of the outer array.", but it should be the second element.
    In the OCP study guide you write under Study Tips > Taking advantage of context clues: 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.

    However, the available answers in the OCA/OCP Practice Tests book's, chapter 3, question 16 and question 38, both include "None of the above", and neither "Does not compile" nor "Throw an exception at runtime", while the explanation for "None of the above" being the correct answer (in both questions), is that the code does not compile.

    Is it possible to get a "None of the above" when there is a compilation error in the exam? If yes, may I suggest that you reformulate the Study Tips in future revisions of the book?