Answers for "java stream anymatch vs findany"

0

java stream anymatch vs findany

They do the same job internally, but their return value is different.
Stream#anyMatch() returns a boolean while Stream#findAny() returns an object
which matches the predicate.
anyMatch is a short-circuit operation, but filter will always process the whole
stream
Posted by: Guest on March-19-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language