About Question enthuware.ocpjp.v8.3.1918 :

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

Moderator: admin

Post Reply
ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

About Question enthuware.ocpjp.v8.3.1918 :

Post by ramy6_1 »

Hello ,

In description of "enthuware.ocpjp.v8.3.1920" , you mentioned that Files.walk walks the directory in a depth first manner, which means, it processes the children of a directory first before moving to the sibling of the directory.

Accordingly the correct answer should be

a
a/b
a/b/parent
a/a.java

which is different that the selected correct answer option 4.

Kindly clarify.

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

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

Post by admin »

parent is not a real directory inside b. It is a symbolic link. The first line of the explanation says, "///Files.walk/// method does not follow symbolic links by default.", so there is no reason why it will print a/b/parent after a/b.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

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

Post by ramy6_1 »

Hello ,
Thanks for your response.

Regardless the parent itself.

Files.walk walks the directory in a depth first manner which means a/b should be processed before a/a.java and that is different than your selected correct answer.

Kindly clarify.

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

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

Post by admin »

Your interpretation of depth first is incorrect. Depth first simply means it will first process the whichever item it picks first, fully before moving to the next sibling. It doesn't imply anything about ordering. a/b and a/a.java are at the same level. There is no guarantee which one will be picked first. What is guaranteed is that whenever a/b is picked, it will process a/b completely (i.e. it will go inside a/b) before moving to a/a.java.

I will suggest you to google "depth first algorithm" to get a more clear understanding.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

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

Post by ramy6_1 »

You are right.
Thanks for clarification.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests