0 votes
in JAVA by
What is the difference between a stateful and stateless operation in a stream pipeline?

a) A stateful operation depends on the order of the stream elements, while a stateless operation does not.

b) A stateful operation modifies the state of the stream pipeline, while a stateless operation does not.

c) A stateful operation requires additional memory, while a stateless operation does not.

d) A stateful operation is always parallel, while a stateless operation is always sequential.

1 Answer

0 votes
by
Answer: b) A stateful operation modifies the state of the stream pipeline, while a stateless operation does not.

Explanation: A stateful operation is one that depends on the state of the stream pipeline, such as sorting or distinct, while a stateless operation is one that does not depend on the state, such as map or filter.

Related questions

+1 vote
asked Jul 10, 2022 in ElasticSearch by sharadyadav1986
0 votes
asked May 7 in JAVA by SakshiSharma
...