Intermediate operations
public class Example {
public static void main(String[] args) {
.filter(predicate)
.map(function)
.flatMap(function)
.distinct()
.sorted() / .sorted(comparator)
.limit(n) / .skip(n)
.takeWhile(predicate) // Java 9+
.dropWhile(predicate)
.peek(consumer) // debugging only
.mapToInt(f) / .boxed()
}
}
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 1 section
- map vs flatMap
Test yourself
Answer these before moving on — recall is what makes it stick.