nerdexam
Oracle

1Z0-809 · Question #37

1Z0-809 Question #37: Real Exam Question with Answer & Explanation

The correct answer is B. Searching"red" Searching"green" Searching"yellow". See the full explanation below for the reasoning.

Question

List<String> colors = Arrays.asList("red", "green", "yellow"); Predicate<String> test = n -> { System.out.println("searching" + n); return n.contains("red"); }; colors.stream() .filter(c -> c.length() >= 3) .allMatch(test); What is the result?

Options

  • ASearching"red" Searching"green" Searching"yellow" Searching"red"
  • BSearching"red" Searching"green" Searching"yellow"
  • CSearching"red" Searching"yellow" Searching"green"
  • DA compilation error occurs.

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice