0 votes
in JAVA by

What is the purpose of the toArray() method in a stream pipeline?

a) To transform the stream into an array

b) To filter the stream elements

c) To terminate the stream and return a single result

d) To perform a side-effect on each element of the stream

1 Answer

0 votes
by

Answer: a) To transform the stream into an array.

Explanation: The toArray() method allows you to convert a stream into an array of elements.

Related questions

0 votes
asked Apr 26 in JAVA by SakshiSharma
0 votes
asked May 5 in JAVA by sharadyadav1986
...