Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sybex OCP Java 8 Study Guide Chapter 9  RSS feed

 
Greenhorn
Posts: 13
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think I've spotted some typos in Chapter 9

P 456, last line : the file package should not have an "s"

... the java.nio.files.Paths factory ...



P 457, first line : Paths has no getPath method, but get methods. This typo is made several times through this chapter.

P 459, Path.getPath() should be Paths.get()

P 463, I'm not sure about the explanation about the PrintWriter being the cause of the call to the toString() method. I would say the string concatenation "+" triggers it first.

P 470, the toRealPath method does not have a Path argument, it's an instance method.

P 489, in the bottom note, it should be "that can be stored in a int" instead of stopped.

P 500 and 570, question 12. I tested answer C and although it compiles, it throws an IllegalArgumentExeption: Missing scheme exception. So I think it should be a correct answer.
Also as noted by Mihaela Hetea in another thread, answer G use a Paths.getPath method which doesn't exists so it should be a correct answer as well. The answer explanation for D and G talks about optional varargs values, which are nowhere to be found.

Thanks
 
author & internet detective
Marshal
Posts: 38146
617
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seb,
Welcome to CodeRanch and thanks for sharing. These corrections (even minor ones) help future readers.

Seb Cano wrote:P 456, last line : the file package should not have an "s"

... the java.nio.files.Paths factory ...



P 457, first line : Paths has no getPath method, but get methods. This typo is made several times through this chapter.

P 459, Path.getPath() should be Paths.get()


Agreed and logged. I'm embarrassed we missed the getPath() part.

Seb Cano wrote:P 463, I'm not sure about the explanation about the PrintWriter being the cause of the call to the toString() method. I would say the string concatenation "+" triggers it first.


This is true. I think we meant more that PrintWriter has a method and that method triggers toString. It could have been worded more clearly, but I'm not going to call this an error. I will note it for future editions on our private list

Seb Cano wrote:P 470, the toRealPath method does not have a Path argument, it's an instance method.

P 489, in the bottom note, it should be "that can be stored in a int" instead of stopped.


Agreed

Seb Cano wrote:Also as noted by Mihaela Hetea in another thread, answer G use a Paths.getPath method which doesn't exists so it should be a correct answer as well.


Agreed. I'm crediting you for this rather than Mihaela in the errata because he had a typo in the question # (he wrote question 20) and I couldn't find it based on that.

Seb Cano wrote: The answer explanation for D and G talks about optional varargs values, which are nowhere to be found.


D uses optional varargs. It has a vararg of length 1. G would have the same if we didn't have the getPath typo in there. Paths.get() takes one String and then 0 or more strings in the form of varargs.

Seb Cano wrote:P 500 and 570, question 12. I tested answer C and although it compiles, it throws an IllegalArgumentExeption: Missing scheme exception. So I think it should be a correct answer.


This one is tricky. You are right, but recognizing that goes beyond what you are expected to know for the exam. I added a note to the errata saying to give yourself credit either way for that one.

Also, have a cow for reporting them in a way that is easy to consume and reproduce.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!