Given the code fragments:
and
What is the result?
A. null
B. A compilation error occurs.
C. DogCatMouse
D. [Dog, Cat, Mouse]
Given the code fragments:
and
What is the result?
A. null
B. A compilation error occurs.
C. DogCatMouse
D. [Dog, Cat, Mouse]
B because void forEach(Consumer action)
B
Answer is B,
tested…