Win a copy of High Performance Python for Data Analytics this week in the Python 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
  • 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

Errata for OCPJP Java 8 Jeanne Boyarsky Chapter 9

 
Greenhorn
Posts: 13
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On Windows, the method Paths.get(URI) doesn't throw a RuntimeException if the URI is not absolute.



The output is:


Also the examples with the http schema throw exception .
From the implementation of getPath(URI) it seems that the file:// schema is taken by default, whereas for the others the method is called, which on my computer returns file and jar. Does this mean that in the context of Path class only URI with schema file can be used or other providers can be installed? (like http for example)

Thanks.
 
Mihaela Hetea
Greenhorn
Posts: 13
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In question 20 of the review questions answer G is considered to be correct, but the Paths method is Paths.get and not Paths.getPath, so answer G should also be invalid.
 
author & internet detective
Posts: 40400
821
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mihaela Hetea wrote:In question 20 of the review questions answer G is considered to be correct, but the Paths method is Paths.get and not Paths.getPath, so answer G should also be invalid.


I don't see a choice G in question 20 (page 503) or hasPath. I checked in my printed book, the e-book and the Sybex online materials.

Can you confirm the question number? And what format of book you are using?

For your other comment in this thread, I need either Scott to confirm or time to get my Windows VM working.
 
Jeanne Boyarsky
author & internet detective
Posts: 40400
821
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Mihaela Hetea wrote:In question 20 of the review questions answer G is considered to be correct, but the Paths method is Paths.get and not Paths.getPath, so answer G should also be invalid.


I don't see a choice G in question 20 (page 503) or hasPath. I checked in my printed book, the e-book and the Sybex online materials.

Can you confirm the question number? And what format of book you are using?

For your other comment in this thread, I need either Scott to confirm or time to get my Windows VM working.


Ah. It's question 12, not question 20! Got it.
 
Mihaela Hetea
Greenhorn
Posts: 13
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is question 12. Sorry, my mistake.
 
Jeanne Boyarsky
author & internet detective
Posts: 40400
821
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mihaela Hetea wrote:On Windows, the method Paths.get(URI) doesn't throw a RuntimeException if the URI is not absolute.


Finally got to try it on Windows.

This throws an exception on both Windows and Mac:


This one throws an Exception on Mac, but not Windows:


I'll note this.

Mihaela Hetea wrote:Also the examples with the http schema throw exception .
From the implementation of getPath(URI) it seems that the file:// schema is taken by default, whereas for the others the method is called, which on my computer returns file and jar. Does this mean that in the context of Path class only URI with schema file can be used or other providers can be installed? (like http for example)


It throws an exception on Mac too. Since http isn't on the exam, that was just meant to show it exists. Not work.
 
There are 10 kinds of people in this world. Those that understand binary get 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