3 ms·
> In your own code you should always use one of collection classes, usually Iterable, Collection or List, depending on which features you need. Yes, but every
by mcv 4y ago
> In your own code you should always use one of collection classes, usually Iterable, Collection or List, depending on which features you need.
Yes, but every library I use requires or returns a different one.
> list.stream().map(...).toList()
But why not list.map(...)?
- kaeruct 4y agoIn this specific case I think it is because stream operations can be implemented lazily - they only run once you call toList()