PrepZone Logo
PrepZone
Back to Java

Java · Medium

Differentiate between intermediate and terminal stream operations with examples.

JavaJava 8+Streams

Answer preview

Intermediate operations — Return a new stream and are lazy — they are not executed until a terminal operation is invoked. Examples: filter(), map(), flatMap(), sorted(), distinct(), peek(), limit(), skip().…