• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Sybex OCP Java 8 Study Guide Chapter 9

 
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: 40354
819
Eclipse IDE VI Editor Java
  • 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.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic