This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Errata for OCPJP Java 8 Jeanne Boyarsky Chapter 9  RSS feed

 
Greenhorn
Posts: 13
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Yes, it is question 12. Sorry, my mistake.
 
Jeanne Boyarsky
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!