java.util.stream.Stream?
Which statement is true about -
java.util.stream.Stream?
Which statement is true about -
A stream cannot be consumed more than once. In Java, once a stream has been operated upon or consumed, it cannot be replayed or reused. If there's a need to perform multiple operations on the same dataset, you would need to create a new stream. Modifying the source data or changing the execution mode during processing are not characteristics of streams, and there is no guarantee that a parallel stream is always faster than a sequential stream due to potential overhead in managing parallel tasks.
A is the answer
Answer is B. Option A use peak() method can do it.
Sorry, the peak() method is an intermediate operation. The answer is A.
A is the answer
The answer is A, the answer cannot be B because peak() is an intermediate operation.
A is correct.