• 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 : OCA/OCP Java SE 8 Programmer Practice Tests - Chapter 19

 
Ranch Hand
Posts: 50
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 28:


The answer says " The method compiles and returns a Path value that is always equivalent to the input argument." which is not correct. When the path is absolute, it returns the same path back, but if it is not null and relative, it returns absolute path , which may be from the current working directory and would not be equivalent to input argument.
ex.


returns
D:\test\path1
D:\Java7Workspace\OCP\test2

The absolute path is equivalent to input path but the relative one is not.
 
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
You're right! Looking at the answer, we meant line 4 to have p.isAbsolutePath() rather than !p.isAbsolutePath()!
 
reply
    Bookmark Topic Watch Topic
  • New Topic