Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 158

Given:

and the code fragment:

What is the result?

    Correct Answer: D

    D

Discussion
Abdullah_RahahleahOption: B

the passed parameter name passed to forEach is wrong, if we change it to src the answer will be B

shivkumarxOption: B

If we ignore the typo in the forEach() method, and the brackets were correct, then the answer is B

steefaandOption: D

D is correct like this. If parenthesis are balanced and scr replaced with src then B is answer.

duydnOption: D

forEach((src, res) -> ...) -> D is correct

WilsonKKerllOption: B

Answer is B if .forEach((src, res) -> System.out.println(src));