• 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 for OCA/OCP Java SE 7 Programmer I & II Study Guide (K&B7)

 
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

J Deckarm wrote:The collections hierarchy figure on page 590 is numbered "figure 7-2", yet we are in chapter 11, should be likely "figure 11-2"


Only in the electronic version of the book. Added to the errata overview.
 
Ranch Hand
Posts: 41
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
chapter 13, page 728
"from the java.lang.Thread Class"
should be
"Methods from the java.lang.Thread Class"
 
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
Hi Anton Vargas,

First of all, a warm welcome to CodeRanch!

Anton Vargas wrote:Chapter 1
Launching applications with java
java -version MyClass 1

Explained as "show me JVM version, launch MyClass.class and pass 2 arguments".

But, java ignores everything after -version, right?


You are correct! According to the official Oracle documentation about the java command the option -version displays version information and exits; the option -showversion displays version information and continues. So it should have been java -showversion MyClass x 1

Added to the errata overview.

Kind regards,
Roel
 
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

Paddy O Riley wrote:Chapter 6 pg 351/7/8 AssertionError
The term "AssertionError" first appears on page 351 for the OCA exam and is again mentioned on 357/8. No definition or explanation is provided as to what this is and neither is there any comment of the form "Assertions are covered in detail for the OCP exam but for the OCA exam you just need to know ..... <fill in what is necessary for the OCA exam>".


Added to the errata overview.

Paddy O Riley wrote:Is the expectation that we should know about Assertions etc from our own experience for the OCA exam or is some extra info required in the book to position us for the OCA exam in this regard ?


This is a left-over of dividing the study guide in Part I (for OCA) and Part II (for OCP). Assertions are covered (as you know) in the OCP part (chapter 7), so for the OCA exam you only need to know that AssertionError IS-A Error (so not a subclass of Exception nor RuntimeException).

Hope it helps!
Kind regards,
Roel
 
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
Hi Charles Lewis,

First of all, a warm welcome to CodeRanch!

Charles Lewis wrote:page 929

So when a Connection is closed, any Statement created from that Connection is also closed, and likewise, when a Statement is closed, any ResultSet created using that ResultSet is also closed.

I propose "Statement"


Added to the errata overview.

Kind regards,
Roel
 
J Deckarm
Ranch Hand
Posts: 41
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 1, page 62
Each of the enumerated CoffeeSize types is actually an instance of CoffeeSize
should be likely
Each of the enumerated CoffeeSize values is actually an instance of CoffeeSize?
 
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 7: Assertions and Java 7 Exceptions, Self test question 8, page 410/411

Question 8 answer D and E are identical.
 
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

Zhifu Ge wrote:Chapter 12: Inner Classes, page 688, first 3 lines:

"From outside the outer class instance code (including static method code within the outer class), the inner class name must now include the outer class's name:
MyOuter.MyInner"

I found that if you try to declare a reference variable of MyInner from the static method code within the outer class, you don't have to use the "fully qualified" name like MyOuter.MyInner, just MyInner will suffice.


Added to the errata overview.

Additional note: if you are outside the outer class, you can use an import statement of the inner class as well. Then you don't need to use the outer class's name as well. Illustrated in this code snippet:

Hope it helps!
Kind regards,
Roel
 
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

Zhifu Ge wrote:Page 524, 1st sentence (it's in the parentheses), last paragraph, the class name should be StandardWatchEventKinds, not StandardWatchEventsKinds.


Added to the errata overview.
 
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

Zhifu Ge wrote:Page 515, code block at the end of the page, 5th line to the last,
Currently:

Should be :


pablo santamarta esteban wrote:Chapter 9 I/O and NIO page 515[i]

At the bottom of the page, in the source code sample, inside the overriding visitFile method:

Says:
if (file.getFileName().endsWith(".class"))
Files.delete(file);

Should be:
if (file.getFileName().toString().endsWith(".class"))
Files.delete(file);


This double reported errata item is added to the errata overview.
 
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

J Deckarm wrote:chapter 13, page 728
"from the java.lang.Thread Class"
should be
"Methods from the java.lang.Thread Class"


Added to the errata overview.
 
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

J Deckarm wrote:Chapter 1, page 62
Each of the enumerated CoffeeSize types is actually an instance of CoffeeSize
should be likely
Each of the enumerated CoffeeSize values is actually an instance of CoffeeSize?


Added to the errata overview.
 
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
Hi Rijk van de Scheur,

First of all, a warm welcome to CodeRanch!

Rijk van de Scheur wrote:Chapter 7: Assertions and Java 7 Exceptions, Self test question 8, page 410/411

Question 8 answer D and E are identical.


Added to the errata overview.

Kind regards,
Roel
 
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
I discovered an errata item myself too

Chapter 8, Self Test, Question 11 (page 472).

To have exactly the same output as in the possible answershould be

Confirmed & added to the errata overview.
 
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
Happy to announce my work is done and the errata overview is up-to-date again! If I missed one, just let me know and I'll add the errata item immediately.

Now time for me to go
 
Rancher
Posts: 1090
14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 8, Page 437 --

[a-fA-F] Searches for the first six letters of the alphabet, both cases.
So, for instance,

source: "cafeBABE"
index: 01234567
pattern: [a-cA-C]

returns positions 0, 1, 4, 5, 6



should be

returns positions 0, 1, 2, 3, 4, 5, 6, 7


Edit -- Just noticed that the authors have changed the pattern in the example from [a-fA-F] to [a-cA-C]. Not an erratum then.
 
Ranch Hand
Posts: 145
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is an error in an answer to a quiz (OCP Objective - 6.0 Exceptions and Assertions) on the cd.
the quiz is this:


and the correct answer according to the solution is:


- catch
- An ArrayIndexOutOfBoundsException is thrown




but it should be this:


- finally
- An ArrayIndexOutOfBoundsException is thrown

 
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

John Lerry wrote:there is an error in an answer to a quiz (OCP Objective - 6.0 Exceptions and Assertions) on the cd.

but it should be this:


- finally
- An ArrayIndexOutOfBoundsException is thrown


Added to the errata overview.
 
Rijk van de Scheur
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 8: Minor error in the NumberFormat Class example (page 429)

The second line of the example is: When the Country code is added to the Locale as following: then the nfa[3] element is printed with the Euro sign: 123,46 €
 
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

Rijk van de Scheur wrote:Chapter 8: Minor error in the NumberFormat Class example (page 429)

The second line of the example is:


The Euro sign not displaying is not a (minor) error at all, it's even intended. The only (minor) slip-up in this line is the comment "// France": locFR is representing the French locale, not the France locale. The latter one can only be created using new Locale("fr", "FR");

Added to the errata overview.
 
Rijk van de Scheur
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 8: typo in par. Locating Data via Pattern Matching (page 443)

java.util.regex.Pattarn has to be java.util.regex.Pattern
 
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

Rijk van de Scheur wrote:Chapter 8: typo in par. Locating Data via Pattern Matching (page 443)

java.util.regex.Pattarn has to be java.util.regex.Pattern


Added to the errata overview.
 
Greenhorn
Posts: 1
1
C++ Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 08, page 467

The given input: is actually translated into the String by bash before it is passed to the program. $7 is taken to be a variable without a value assigned to it.

The input is probably left unchanged in Windows, but the given answer B, that is would still be wrong. As it is written, the correct answer should be
 
John Lerry
Ranch Hand
Posts: 145
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is an error in an answer to a quiz (OCP Objective - 1.0 Java Class Design) on the cd.
I think the correct answers are A and E because it asks you to find which will NOT compile.
Cattura.JPG
[Thumbnail for Cattura.JPG]
 
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
Hi Chad Philip Johnson,

First of all, a warm welcome to CodeRanch!

Chad Philip Johnson wrote:Chapter 08, page 467

The given input: is actually translated into the String by bash before it is passed to the program. $7 is taken to be a variable without a value assigned to it.


Thanks for solving this mistery. Have a cow for that!

Updated the errata overview.

Kind regards,
Roel

 
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

John Lerry wrote:there is an error in an answer to a quiz (OCP Objective - 1.0 Java Class Design) on the cd.
I think the correct answers are A and E because it asks you to find which will NOT compile.


Added to the errata overview.
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic