The collect() method in the Stream API is a type of ________ operation.

  • Intermediate
  • Stateful
  • Stateless
  • Terminal
The collect() method is a terminal operation in the Stream API. It is used to accumulate the elements of a stream into a collection, such as a List or Set. Terminal operations are those that trigger the processing of the stream and produce a final result.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *