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