This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
I've just taken the first bonus exam from the OCP Java SE 11 Programmer 1 book, and I've noticed a few errors in the questions. The first is question 6, which states that answers A and C are correct. However, a Set only has 1 generic type parameter, so Set<Boolean,Character> cannot be a correct answer.
The second is question 71, which states that a package must always come first in a Java file, making option B incorrect. However, my compiler says that the following is perfectly valid Java:
The third is question 75, which has two correct answers but only allows me to select one.
Jeroen Steenbeeke wrote:. . . question 71 . . . states that a package must always come first in a Java file, making option B incorrect. . . .
B allows you to put the line with the /* comment */ first. Since comments are ignored by the compiler, yes, you are correct: option B is right.
No, Set<Boolean, Character> looks incorrect, assuming that Set means the same as this type. I think you are correct there.
I am not quite sure about Q75; the primitive types are not “small” and “large”, but “narrow” and “wide”. Yes, float→double is arranged in order from narrow to wide. The question does have B, F as its solution, so the error is not in how it is written, but how it was programmed into the website.
I've added the first two the errata list. For the third, it was right in the version we submitted. We even used the metadata so it would show up as a checkbox. I'm working with the publisher on what happened in between.