Given the code fragment:List<Integer> values = Arrays.asList (1, 2, 3);values.stream ().map(n -> n*2) //line n1.peek(System.out::print) //line n2.count();What is the result?
A. 246
B. The code produces no output.
C. A compilation error occurs at line n1.
D. A compilation error occurs at line n2.
Given the code fragment:List<Integer> values = Arrays.asList (1, 2, 3);values.stream ().map(n -> n*2) //line n1.p
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Given the code fragment:List<Integer> values = Arrays.asList (1, 2, 3);values.stream ().map(n -> n*2) //line n1.p
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!