Difference between and intermediate and a terminal operation? - Cracking the Java Coding Interview

preview_player
Показать описание
Cracking the #Java #Coding #Interview - Question 82: What is the difference between and intermediate and a terminal operation?
Рекомендации по теме
Комментарии
Автор

It's worth noting that map, filter, and flatMap of java.util.Optional are *not* implemented lazily like they are for streams, despite nearly identical semantics.

I'm not sure though if that's part of the official contract or an implementation detail that could be changed in later releases.

jay_sensz
Автор

Just an additional information.
We have one method in Stream, which is neither an intermediate operation, nor a terminal operation.

public boolean isParallel()

This method though not returning a Stream, is not a terminal operation.
All other methods of Stream are either intermediate operation or terminal operation.

uurnybd
Автор

Greetings from Isaac, Uganda. Yes Mr Interview Guru can you recommend here some good java books. Thank you.

isaacwhiz
Автор

I wish java would come with a lightweight stream API that doesn't generate a statemachine.

Also if you try to use a distinct method on a primitivestream why is the stream casted to a Object stream and back?

Speiger
Автор

Why I need to learn python for ML why can't Java achieve the same height.

thecoder