I am little confused between Stream#findAny()
and Stream#findFirst()
of the Stream
API in Java 8.
What I understood is that both will return the first matched element from the stream, for example, when used in conjunction with filter?
So, why two methods for the same task? Am I missing something?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…