Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Errata - OCP Java SE 8 Study Guide - Chapter 1

 
Author
Posts: 42
7
Android Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would like to report a handful of small typos and some other points.

page 3:
1) missing close paren after System.out.println(cat.id);
2) imports; Lynx and Mouse can't see BigCat right now...

page 11:
"Since only the Animal superclass has a careFor method, it executes." -> why 'only'? Lion has it, too.

page 13:
"All classes in Java inherit from java.lang.Object, either directly or indirectly, which means that all classes inherit any methods defined in Object." -> Javadoc uses 'the' rather than 'any'; after all, Object does declare a single uninheritable method, namely private static native void registerNatives().

page 29:
"four is not effectively final. Even though the assignment happens after the inner class, it is not allowed." -> In this particular example the Inner class doesn't reference the var four so the code compiles as written…

page 35:
1) "Local inner classes are … not allowed to have static members" -> 'except for static final fields' (just like on page 28 as already reported in Errata)
2) "must not declare any new or broader exceptions" -> 'checked'

 
author & internet detective
Posts: 41967
911
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

Igor Soudakevitch wrote:page 3:
1) missing close paren after System.out.println(cat.id);


This is on the third line of the page? The close paren is there in my copy. Are you using an e-book? If so, what format? (so I can note it is specific to the e-book)

Igor Soudakevitch wrote:
2) imports; Lynx and Mouse can't see BigCat right now...


I added this to the errata:
In the code example, "Lynx extends BigCat" should be "Lynx extends cat.BigCat"

We want to call attention to the package declarations. Using the fully qualified class names let us do that.

Igor Soudakevitch wrote:
page 11:
"Since only the Animal superclass has a careFor method, it executes." -> why 'only'? Lion has it, too.


Because only Animal declares the method. Lion inherits it. In fact the sentence is about Lion calling that very method that it inherits.

Igor Soudakevitch wrote:
page 13:
"All classes in Java inherit from java.lang.Object, either directly or indirectly, which means that all classes inherit any methods defined in Object." -> Javadoc uses 'the' rather than 'any'; after all, Object does declare a single uninheritable method, namely private static native void registerNatives().


Semantics . The JavaDoc and Java Spec have to be more precise and apply to all of Java, not just what is on the exam. A book goes for understanding. A study guide has the goal of getting you ready for what is on the exam. It is clear what the sentence means. The registerNatives method is way outside the scope of the exam.

Igor Soudakevitch wrote:
page 29:
"four is not effectively final. Even though the assignment happens after the inner class, it is not allowed." -> In this particular example the Inner class doesn't reference the var four so the code compiles as written…


We didn't say the code doesn't compile. We said that four isn't effectively final.

Igor Soudakevitch wrote:
page 35:
1) "Local inner classes are … not allowed to have static members" -> 'except for static final fields' (just like on page 28 as already reported in Errata)


Agreed. Added to errata.

Igor Soudakevitch wrote:
2) "must not declare any new or broader exceptions" -> 'checked'


Agreed. Added to errata.
 
Igor Soudakevitch
Author
Posts: 42
7
Android Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using an ebook; here's the metadata:

the string of numbers at the bottom: 10 9 8 7 6 5 4 3 2 1
ISBN: 978-1-119-06790-0
ISBN: 978-1-119-06788-7 (ebk.)
ISBN: 978-1-119-06789-4 (ebk.)

----------------------------------------------------------------------------------
Another batch of small typos or just some points of interest (mostly in Chapter 1):
----------------------------------------------------------------------------------

page 12, smack in the middle:
"Java ignores whitespace, which means that lines 5 and 6 could be merged into one":
Line 6 didn't specify args so boolean b should probably be removed at this point as we are not discussing unintentional overloading yet.

-------------------
page 25, the second-to-last bullet point:
"Cannot declare static fields or methods" -> + static initializers + member interfaces (and classes, too?); compile-time constants are allowed, though.

-------------------
page 28, the second bullet point:
Same static-related clarifications apply to the local inner classes, as well.

-------------------
page 35, the "Identify and use nested classes" block:
Saying just 'static members' without further qualification again leaves out constants not to mention static initializers. What's more, this restriction is mentioned for local inner classes only; the wording should probably be extended somehow to cover member inner classes as well…

-------------------
page 665, Index:
scheduleAtFixedDelay -> scheduleWithFixedDelay

 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Igor Soudakevitch wrote:
page 12, smack in the middle:
"Java ignores whitespace, which means that lines 5 and 6 could be merged into one":
Line 6 didn't specify args so boolean b should probably be removed at this point as we are not discussing unintentional overloading yet.


Agreed. Added to errata.

Igor Soudakevitch wrote:
page 25, the second-to-last bullet point:
"Cannot declare static fields or methods" -> + static initializers + member interfaces (and classes, too?); compile-time constants are allowed, though.

page 28, the second bullet point:
Same static-related clarifications apply to the local inner classes, as well.

page 35, the "Identify and use nested classes" block:
Saying just 'static members' without further qualification again leaves out constants not to mention static initializers. What's more, this restriction is mentioned for local inner classes only; the wording should probably be extended somehow to cover member inner classes as well…


True. Beyond the scope of the point we are making there.

Igor Soudakevitch wrote:
page 665, Index:
scheduleAtFixedDelay -> scheduleWithFixedDelay


Recorded as an errata against page 346. The index is auto generate from the text.

 
reply
    Bookmark Topic Watch Topic
  • New Topic