Oracle
1Z0-829 · Question #10
1Z0-829 Question #10: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-829 to reveal the answer and full explanation for question #10. The question stem and answer options stay visible for context.
Working with Streams and Lambda expressions
Question
Given the code fragment:
List<String> specialDays = List.of("NewYear", "Valentines","Spring","Labour");
System.out.println(specialDays.stream().allMatch(s -> s.equals("Labour")));
System.out.println("+" + specialDays.stream().anyMatch(s -> s.equals("Labour")));
System.out.println("+" + specialDays.stream().noneMatch(s -> s.equals("Halloween")));
System.out.println("+" + specialDays.stream().findFirst());
What is the result?
Options
- AFalse true false Newyear
- B0110
- CTrue true false Newyear
- D010 optional (Newyear)
Unlock 1Z0-829 to see the answer
You've previewed enough free 1Z0-829 questions. Unlock 1Z0-829 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.
Topics
#Stream terminal operations#allMatch/anyMatch/noneMatch#findFirst#Optional