Dominik Bauer wrote:Well, the result is, that the code cannot be executed, because the main-method is missing the static keyword ;)
Agreed! Well spotted!
PS. You have created a topic in the OCAJP forum which is not the most appropriate forum to post errata about the Java OCP 8 Programmer II Study Guide. You should use the OCPJP forum instead. I have already moved your topic to this forum (for your convenience).
I hope it's ok to use this thread since I found another mistake in question 3 of the assessement test. Imho, and IntelliJ's and that of javac, the code does not compile because of line 2. Based on the assumption that the code is saved in a file named Bird.java (since the main method is in the Bird class) the compiler throws an error on line 2:
That is, of course, true since it is not allowed to have two public classes in one file (according to the line numbers the code obviously is meant to be in the same file). Since there is no appropriate answer I guess the public access modifier should be removed from class Tail.
Welcome to CodeRanch! It's fine to use this thread.
You are correct that there shouldn't be two classes with a public modifier. I'm not adding it to the errata since technically it isn't one. (The question doesn't say that only the lines mentioned have compiler errors). Clearly this isn't the intent though so I adde dit to our private list of things to fix in a OCP 9 book.