• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 42003
911
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()!
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic