Page 1 of 1

About Question enthuware.ocpjp.v8.3.1919 :

Posted: Fri Aug 25, 2017 9:35 am
by alexm1980
I see in the explanation, as is see on the Java 8 documentation of walk method, that are only two overloaded walk methods. How can be option three correct, because i cannot see a walk method that takes two arguments like this:

public static Stream<Path> walk(Path start, int maxDepth)

Thanks!

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

Posted: Fri Aug 25, 2017 11:09 pm
by admin
The method that will be used in this case is :
public static Stream<Path> walk(Path start,
int maxDepth,
FileVisitOption... options)
throws IOException

Observe that the third parameter is using the varargs format (dot dot dot), which means you can omit this parameter.

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

Posted: Sun Aug 27, 2017 12:59 am
by alexm1980
Yes, you are right. Completely understood. Thank you!