| Java Version | Feature | Description |
|---|---|---|
| Java 9 | takeWhile() | Takes elements while condition is true |
dropWhile() | Drops elements while condition is true | |
ofNullable() | Creates a stream with 0 or 1 element (handles null safely) | |
| Java 10 | Collectors.toUnmodifiableList() | Creates an immutable list |
| Java 11 | Stream.iterate() (With Predicate) | Stops automatically based on condition |
| Java 12 | teeing() | Merges results from two collectors |
| Java 16 | toList() | Simplifies list collection |
| Java 17 | mapMulti() | Alternative to flatMap(), more efficient |
No comments:
Post a Comment