1Z0-809 practice question 7 of 25

Given the code fragment: List str = Arrays.asList (“my”, “pen”, “is”, “your’, “pen”); Predicate test = s -> { int i = 0; boolean result = s.contains…

Choose your answer, then check it against the explanation.

Given the code fragment: List str = Arrays.asList (“my”, “pen”, “is”, “your’, “pen”); Predicate test = s -> { int i = 0; boolean result = s.contains (“pen”); System.out.print(i++) + “:”); return result; }; str.stream() .filter(test) .findFirst() .ifPresent(System.out ::print); What is the result?
Answer options
Question 7 of 25

Keep practicing

Take the free 1Z0-809 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other 1Z0-809 practice questions

Scroll to Top