Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 179

Given the directory structure:

and

What is the result?

    Correct Answer: C

    The code snippet finds all directories within the given path up to the specified depth using a BiPredicate. The depth specified is 1, meaning it will look for directories within the 'continent' directory and its immediate subdirectories. In this case, the immediate subdirectory of 'continent' is 'country', and the output will include both '/continent' and '/continent/country'. Therefore, the result will be the paths of these directories.

Discussion
ASPushkinOption: C

C is correct But is not right to write : BiPredicate pred = (path, fileAttrs) -> { BiPredicate is a raw type and same as BiPredicate<Object, Object> and BiPredicate<Path, BasicFileAttributes> is not subtype of BiPredicate<Object, Object> so should be BiPredicate<Path, BasicFileAttributes> pred = (path, fileAttrs) -> { ...

d7bb0b2Option: C

C is correct: /continent /continent/country only print the "directories" with 1 of depth, so find in parent /continent and is subdirectory /continent/country if depth was 2 then print : /continent /continent/country /continent/country/state