About Question enthuware.ocpjp.v7.2.1610 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
kashyapa
Posts: 23
Joined: Thu May 08, 2014 5:27 am
Contact:

About Question enthuware.ocpjp.v7.2.1610 :

Post by kashyapa »

Path p1 = Paths.get("c:\\company\\records\\customers.dat");
Path p2 = p1.resolveSibling("\\clients.dat")
This will set p2 to c:\clients.dat, which is not what you want.
How this happens?

There’s no vast different with;
Path p2 = p1.resolveSibling("clients.dat");
but it provides;
c:\\company\\records\\client.dat

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1610 :

Post by admin »

I am not sure what you mean by "no vast difference". \\clients.dat starts with \, which is the root component, while clients.dat is relative path. This is a vast difference.
-Paul.

kashyapa
Posts: 23
Joined: Thu May 08, 2014 5:27 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1610 :

Post by kashyapa »

thanks i got it.

colmkav
Posts: 21
Joined: Thu Jul 16, 2015 4:22 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1610 :

Post by colmkav »

resolveSibling doesnt seem to be anywhere in the course material I have read in preparation. Is this on the syllabus? Seem to be quite a few things appear in these questions that don't appear in the course material.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1610 :

Post by admin »

Replied to your same question here
viewtopic.php?f=2&t=3311

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests