Oracle
1Z0-809 · Question #4
Given the code fragment: ``java List<Integer> values = Arrays.asList(1, 2, 3); values.stream() .map(n -> n*2)//line n1 .peek(System.out.println)//line n2 .count(); `` What is the result?
The correct answer is B. The code produces no output. You've hit your session limit · resets 5:20pm (America/New_York)
Question
Given the code fragment:
List<Integer> values = Arrays.asList(1, 2, 3);
values.stream()
.map(n -> n*2)//line n1
.peek(System.out.println)//line n2
.count();
What is the result?Options
- A246
- BThe code produces no output.
- CA compilation error occurs at line n1.
- DA compilation error occurs at line n2.
How the community answered
(43 responses)- A2% (1)
- B81% (35)
- C5% (2)
- D12% (5)
Explanation
You've hit your session limit · resets 5:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.