Oracle
1Z0-809 · Question #216
1Z0-809 Question #216: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #216. The question stem and answer options stay visible for context.
Question
Given the code fragment:
List<String> words = Arrays.asList("win", "try", "best", "luck", "do");
Predicate<String> test1 = w -> {
System.out.println("Checking..."); // line n1
return w.equals("do");
};
Predicate test2 = (String w) -> w.length() > 3; // line n2
words.stream()
.filter(test2)
.filter(test1)
.count();
What is the result?
Options
- AA compilation error occurs at line n1.
- BChecking...
- CChecking... Checking...
- DA compilation error occurs at line n2.
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.