Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What does this code do?
List nums = List.of(1, 2, 3);nums.stream().map(n -> n * 2).forEach(System.out::println);
nums = List.of(1, 2, 3);
nums.stream().map(n -> n * 2).forEach(System.out::println);
Prints
2 4 6
1 2 3
Compilation
error
Runtime
exception
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!