About Question enthuware.ocpjp.v8.2.1757 :
Moderator: admin
-
- Posts: 27
- Joined: Fri Jul 22, 2016 9:14 am
- Contact:
About Question enthuware.ocpjp.v8.2.1757 :
Why the forward slashes in the task become back slashes in the answer?
I mean, is it a typo or do I miss something?
I mean, is it a typo or do I miss something?
-
- Site Admin
- Posts: 9804
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1757 :
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.
-Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Mon Apr 06, 2020 8:57 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1757 :
The answer here doesn't contain a new line, it should be
Code: Select all
/works
/works/ocpjp/code
-
- Site Admin
- Posts: 9804
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1757 :
I do see a new line. Could you please post a screen shot of what you see?
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Thu Dec 09, 2021 11:23 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1757 :
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
i.e.
Path d1 = Paths.get("/works/ocpjp"); -> d1.toAbsolutePath(); will return /works/ocpjp
Path d1 = Paths.get("/works"); -> d1.toAbsolutePath(); will return /works
-
- Site Admin
- Posts: 9804
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1757 :
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.
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Thu Dec 09, 2021 11:23 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1757 :
great, thanks for the expanation!
Who is online
Users browsing this forum: Bing [Bot] and 4 guests