This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

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
Posts: 39208
726
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.
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!