This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errata OCP Appendix A Chapter 1 Question 19 – public static void toddle(){} - Sybex  RSS feed

 
janne kalliokulju
Greenhorn
Posts: 2
AngularJS Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Have just started preparing for the OCJP -certification and have gone through the first chapter's reviews. Wondering about the question 19 and its suggestions that

should compile.

According to my understanding non-static nested class may not have statically declared member variables nor methods and therefore the wording of the answer, I think,
should be changed into "D does not compile". Or have I missed something?

Br Janne

 
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37234
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Janne,
Welcome to CodeRanch! I added the publisher of the book to your subject. There are multiple OCP books so this helps us know which one it goes with.

You are correct that Option D doesn't compile. This is in the errata and was originally reported last year.
 
janne kalliokulju
Greenhorn
Posts: 2
AngularJS Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Sorry. I tried to search for it, but couldn't find. Also checked the problem at

https://www.selikoff.net/java-ocp-8-programmer-ii-study-guide/
Errata -section

and as it wasn't there so decided to submit a post. Thanks anyway.

Jan
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!