• 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)

 
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 15, self test q10, answer D
"numbBooks" should be likely replaced with "numBooksRemoved"
 
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 15, page 919
"To initially load a CachedResultSet..." should be CachedRowSet?
 
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 15, self test, q11, answer D
contains rsf.createRowSet(), but there is apparently no such method in RowSetFactory. should be likely rsf.createJdbcRowSet()
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 3, answer to question 7 (Page 220)

G is incorrect: Apart from the three Wind objects that are ready to be garbage collected, there is also an unreferenced String object (value "1 2", the one that was created in the System.out.println - line). So, there are 4 objects eligible for garbage collection.

The valid answers are A and B, or the text of option G should read "Three objects of type Wind are eligible for garbage collection"
 
Greenhorn
Posts: 3
Tomcat Server Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think I found a (non critical) typo in Self Test 4, Question 8 Page 253 Line 10:

Second part of the test
should be an assignment
The assignment isn't executed anyway because of b1 already satisfying the short circuit OR, which is also what the explanation on page 256 suggests.
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page 65 - Chapter 1:
"... enum that looks like an anonymous inner class (which we talk about in Chapter 8) ..."
Should be Chapter 12
 
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 268 "Unfortunately, the ending argument is not zero-based ..." , should be "Unfortunately, the ending argument is not zero-based ..."

Both arguments are zero-based:
 
D Figu
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page 297 - last bullet point

ArrayList methods to remember:

"...get(index), indexOf(), remove(index)..."

should be

"...get(index), indexOf(object), remove(index)..."
 
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 Sergey,

First of all, a warm welcome to CodeRanch!

Sergey Butenko wrote:In class Writer2, page 483

the comment "how many bytes read" is not correct there since read() method reads characters but not bytes, and it returns the number of characters read


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

Chris Heinz wrote:Page 766 Chapter 13 Threads 4th bullet

From what I've read about threads, it's not possible to go from waiting to running, but I'm also not completely clear on what the, "(well, for all practical purposes anyway)" comment is intended to mean, so maybe it is valid, but I'm not understanding this comment in the correct context...


I don't understand the comment in between parentheses either.

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

Chris Heinz wrote:Page 871 Chapter 15

Just a simple typo...


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

Chris Heinz wrote:Page 872 Chapter 15 code snippet at top of page


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 Oli Brown,

First of all, a warm welcome to CodeRanch!

Oli Brown wrote:On page 886, chapter 15: JDBC in Figure 15-6 I think there is a small error with how the invocations are numbered. In the book it is marked 1,2,3 but I think they should be marked 1,3,2 for the invocations to make sense.


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
Hi J Deckarm,

First of all, a warm welcome to CodeRanch!

J Deckarm wrote:Chapter 15, self test q10, answer D
"numbBooks" should be likely replaced with "numBooksRemoved"


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

J Deckarm wrote:chapter 15, page 919
"To initially load a CachedResultSet..." should be CachedRowSet?


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 15, self test, q11, answer D
contains rsf.createRowSet(), but there is apparently no such method in RowSetFactory. should be likely rsf.createJdbcRowSet()


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 Walter,

First of all, a warm welcome to CodeRanch!

Walter van Iterson wrote:Chapter 3, answer to question 7 (Page 220)

G is incorrect: Apart from the three Wind objects that are ready to be garbage collected, there is also an unreferenced String object (value "1 2", the one that was created in the System.out.println - line). So, there are 4 objects eligible for garbage collection.


In fact, the print statement will create 2 temporary (unreferenced) String objects ("1 " and "1 2"). More info about this particular self test question can be found in this thread.

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
Hi Richard,

First of all, a warm welcome to CodeRanch!

Richard Osseweyer wrote:Think I found a (non critical) typo in Self Test 4, Question 8 Page 253 Line 10:


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
Hi Krzysztof,

First of all, a warm welcome to CodeRanch!

Krzysztof Kicinger wrote:Page 65 - Chapter 1:
"... enum that looks like an anonymous inner class (which we talk about in Chapter 8) ..."
Should be Chapter 12


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
Hi D Figu,

First of all, a warm welcome to CodeRanch!

D Figu wrote:On page 268 "Unfortunately, the ending argument is not zero-based ..." , should be "Unfortunately, the ending argument is not zero-based ..."

Both arguments are zero-based:


True! 0 is a legal end index, which it wouldn't be if the end index was one-based. Both indexes are zero-based, but the end index is exclusive, whereas the begin index is inclusive. So this code is valid and print the empty string:Output:
##

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

D Figu wrote:Page 297 - last bullet point

should be
"...get(index), indexOf(object), remove(index)..."


True! And the same applies to the contains method as well

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
Chapter 4, page 235, table 4.1 - If you try to check if Foo[] is of type Foo using the instanceof operator, you will get a compiler error (not false).

An errata item mentioned by Vince Tan (and discussed) in this thread.

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
It took me a while longer as usual, but I was very busy the past few weeks and we had the OCAJP8 study guide book promotion as well.

But I can now let you all know (with some pride ): the errata overview is up-to-date again, all new reported errata (14) were added. To improve the ease of use, I have added to each confirmation the url to the exact location of the errata item in the errata overview, both for the new additions as the old ones. Hope you'll appreciate and enjoy this little improvement!

Thanks for reporting all these errata items!

Happy studying!
 
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pagina 112, Chapter 2: Object Orientation
error numeros de tablas. (wrong typo)
Actualmente (Currently) --> TABLE 1-2 Differences Between Overloaded and Overridden Methods
deberia ser (Should be) --> TABLE 2-3 Differences Between Overloaded and Overridden Methods
 
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 1 Pg 52 Section Instance Variables
Currently : Private String title,
Should be : Private String title;
 
sergio enrique rojas moncada
Greenhorn
Posts: 5
Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pagina 120 Chapter 2: Object Orientation.
error in figure 2-5

Currently: abstract Ball implements Bounceable
Should be: abstract class Ball implements Bounceable

 
Paddy O Riley
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the errata,

page 253: Self Test, Question 8
On line 10 of the code snippet, the assignment operator (=) should be used instead of the equality operator (==).

Currently:
10. if(b1 || (b2 == true)) s += "y";

Should be:
10. if(b1 || (b2 = true)) s += "y";

However in the digital version I received with the book, this question is now on page 252.
Is it possible to indicate the discrepency in page numbers going forward, if it exists ?
 
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:However in the digital version I received with the book, this question is now on page 252.
Is it possible to indicate the discrepency in page numbers going forward, if it exists ?


The page numbers listed on the errata overview are always the page numbers of the printed version of the book, unless mentioned otherwise. The description after the page number is equally important as the page number, because in most cases you can locate the errata item with just this description (certainly with the self test questions and answers). So I think there's no need to add another page number (if different) to the errata overview.
 
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
The collections hierarchy figure on page 590 is numbered "figure 7-2", yet we are in chapter 11, should be likely "figure 11-2"
 
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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?
 
Paddy O Riley
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 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>". As has been pointed out in several places in the book, Chapter 7 covers Assertions in detail. 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 ?
 
Greenhorn
Posts: 8
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"
 
Greenhorn
Posts: 16
1
Mac Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

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. For example, the code below compiles just fine.

 
Zhifu Ge
Greenhorn
Posts: 16
1
Mac Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page 524, 1st sentence (it's in the parentheses), last paragraph, the class name should be StandardWatchEventKinds, not StandardWatchEventsKinds.
 
Zhifu Ge
Greenhorn
Posts: 16
1
Mac Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page 515, code block at the end of the page, 5th line to the last,
Currently:

Should be :

Reason being:

boolean endsWith(String other)
Tests if this path ends with a Path, constructed by converting the given path string, in exactly the manner specified by the endsWith(Path) method. On UNIX for example, the path "foo/bar" ends with "foo/bar" and "bar". It does not end with "r" or "/bar". Note that trailing separators are not taken into account, and so invoking this method on the Path"foo/bar" with the String "bar/" returns true.

 
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 9 I/O and NIO page 515

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);

It is intended to filter all .class files and remove them, isn't it?

endsWith(String other) method from Path interface API says:
"On UNIX for example, the path "foo/bar" ends with "foo/bar" and "bar". It does not end with "r" or "/bar". Note that trailing separators are not taken into account, and so invoking this method on the Path"foo/bar" with the String "bar/" returns true."

Should be:
if (file.getFileName().toString().endsWith(".class"))
Files.delete(file);
 
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 sergio enrique rojas moncada,

First of all, a warm welcome to CodeRanch!

sergio enrique rojas moncada wrote:pagina 112, Chapter 2: Object Orientation
error numeros de tablas. (wrong typo)
Actualmente (Currently) --> TABLE 1-2 Differences Between Overloaded and Overridden Methods
deberia ser (Should be) --> TABLE 2-3 Differences Between Overloaded and Overridden Methods


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 1 Pg 52 Section Instance Variables
Currently : Private String title,
Should be : Private String title;


Be careful! Java is case-sensitive, private is a Java keyword ("Private" is not).

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

sergio enrique rojas moncada wrote:pagina 120 Chapter 2: Object Orientation.
error in figure 2-5

Currently: abstract Ball implements Bounceable
Should be: abstract class Ball implements Bounceable


Added to the errata overview.
 
reply
    Bookmark Topic Watch Topic
  • New Topic