Question 115 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question 115 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question

Given the code fragment:

List<Integer> prices = Arrays.asList(3, 4, 5);

prices.stream()
-filter(e -> e > 4)
-peek(e -> System.out.print ("Price " + e)) // line nt
-map(n -> n — 1) // line n2
-peek(n -> System.out.printin(" New Price " + n)); // line n3

Which modification enables the code to print Price 5 New Price 4?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.