Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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(...)?



In this specific case I think it is because stream operations can be implemented lazily - they only run once you call toList()




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: