• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 41860
908
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: 41860
908
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: 41860
908
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic