• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Errata Assessment Test MQ 3 (Java OCP 8 Programmer II Study Guide, Sybex)

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

thank you for writing the book, and for adding me in the acknowledgements ;)

I found a minor bug in the mock questions of the Assessment Test at page xxxix.
It is about Mock question 3 (What is the result of executing the following code?)

Well, the result is, that the code cannot be executed, because the main-method is missing the static keyword ;)

the signature of the main method in the book is:

it is missing a static keyword. It should look this one:




 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).
 
Dominik Bauer
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

sorry for choosing the wrong forum. The next one will be in the appropriate one.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dominik Bauer wrote:The next one will be in the appropriate one.


 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agreed and logged in the errata
 
Greenhorn
Posts: 4
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kilian,
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.

Have a cow for pointing this out!
 
reply
    Bookmark Topic Watch Topic
  • New Topic