Page 1 of 1

About Question enthuware.ocpjp.v8.2.1757 :

Posted: Wed Aug 03, 2016 11:02 am
by badbishop
Why the forward slashes in the task become back slashes in the answer?
I mean, is it a typo or do I miss something?

Re: About Question enthuware.ocpjp.v8.2.1757 :

Posted: Wed Aug 03, 2016 11:44 am
by admin
The explanation notes, "Assuming that C:\ is the root of the file system.". The author probably verified the results on windows system. You will see \ instead of / on windows.
-Paul.

Re: About Question enthuware.ocpjp.v8.2.1757 :

Posted: Mon Apr 06, 2020 8:59 am
by sasisachka
The answer here doesn't contain a new line, it should be

Code: Select all

/works
/works/ocpjp/code

Re: About Question enthuware.ocpjp.v8.2.1757 :

Posted: Mon Apr 06, 2020 10:36 am
by admin
I do see a new line. Could you please post a screen shot of what you see?
test.png
test.png (34.36 KiB) Viewed 1617 times

Re: About Question enthuware.ocpjp.v8.2.1757 :

Posted: Thu Jan 26, 2023 3:44 am
by yuir12
Hi, can you please explain method toAbsolutePath()? Does it return result as per initialized value?
i.e.

Path d1 = Paths.get("/works/ocpjp"); -> d1.toAbsolutePath(); will return /works/ocpjp
Path d1 = Paths.get("/works"); -> d1.toAbsolutePath(); will return /works

Re: About Question enthuware.ocpjp.v8.2.1757 :

Posted: Thu Jan 26, 2023 5:27 am
by admin
Not necessarily. Please go through this description.
Path toAbsolutePath()
Returns a Path object representing the absolute path of this path.
If this path is already absolute then this method simply returns this path. Otherwise, this method resolves the path in an implementation dependent manner, typically by resolving the path against a file system default directory. Depending on the implementation, this method may throw an I/O error if the file system is not accessible.

Re: About Question enthuware.ocpjp.v8.2.1757 :

Posted: Sun Jan 29, 2023 11:24 pm
by yuir12
great, thanks for the expanation!