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

Are you making an assumption based on some specific "lists" or are Java 'streams' infinite?

https://en.wikipedia.org/wiki/List_(abstract_data_type)

https://en.wikipedia.org/wiki/Stream_(abstract_data_type)



Java Streams apply to Collections, which is a broader abstraction than a list.


"A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists." (https://en.wikipedia.org/wiki/List_comprehension)

Stream's terminal operations contains much more options than just "creating a list".


> or are Java 'streams' infinite?

They are in toy examples.

I don't follow your original point 100%, but I will say that 90% of the time when I use Streams, I'm really just wishing List had map and filter, etc.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: