Browsed by
Tag: Streams

Terminal and Intermediate operations in the Java 8 Stream API

Terminal and Intermediate operations in the Java 8 Stream API

When working with the Stream API in Java 8, there are two groups of methods that you need to be aware of. These two groups are referred to as terminal and intermediate operators. Intermediate operators These are the methods in the Stream API that returns a new Stream, these are: distinct – Will only let through unique values, based on the objects equals method. filter – Takes a Predicate that should return true or false. True if the object should…

Read More Read More