Exam 1z0-816 All QuestionsBrowse all questions from this exam
Question 16

Given:

Which statement is equivalent to line 1?

    Correct Answer: D

    The equivalent statement to line 1 is 'double totalSalary = list.stream().mapToDouble(e −> e.getSalary() * ratio).reduce(starts, bo);'. This statement correctly utilizes the mapToDouble function to convert the stream to a DoubleStream, applies the provided mapping function, and reduces it using the specified initial value (starts) and the provided BinaryOperator (bo). Other options either have syntax errors or do not use the correct method chain to achieve the same result as the original statement.

Discussion
mrc61Option: B

B True If endsWith ....sum();

Sa16253748596Option: B

B is true