This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filter() :- Filters elements based on a predicate stream.filter(x -> x > 10) | |
| map() :- Transforms each element stream.map(String::toUpperCase) | |
| flatMap() :- Flattens nested structures stream.flatMap(List::stream) | |
| distinct() :- Removes duplicates stream.distinct() | |
| sorted() :- Sorts elements stream.sorted() | |
| peek() :- Performs action without modifying the stream stream.peek(System.out::println) | |
| limit() :- Limits the number of elements stream.limit(5) | |
| skip() :- Skips the first N elements stream.skip(3) | |
| forEach() :- Applies an action to each element stream.forEach(System.out::println) | |
| collect() :- Converts stream to a collection or summary stream.collect(Collectors.toList()) |