0 votes
in JAVA by
Which of the following is true about the Stream.flatMap() method in Java 8?

a) It returns a new stream that is the result of applying a reduction operation to the elements of the stream.

b) It performs a mutable reduction operation on the elements of the stream.

c) It performs an immutable reduction operation on the elements of the stream.

d) It returns a new stream that is the result of applying a function to each element of the stream and flattening the result.

1 Answer

0 votes
by

Answer: d) It returns a new stream that is the result of applying a function to each element of the stream and flattening the result.

Explanation: The Stream.flatMap() method returns a new stream that is the result of applying a function to each element of the stream and flattening the result into a single stream.

...