Java 8 Stream vs Collection Storage

前端 未结 5 1620
情深已故
情深已故 2021-02-02 01:38

I have been reading up on Java 8 Streams and the way data is streamed from a data source, rather than have the entire collection to extract data from.

This quote in par

5条回答
  •  粉色の甜心
    2021-02-02 01:46

    A stream is just a view of the data, it has no storage of its own and you can't modify the underlying collection (assuming it's a stream that was built on top a collection) through the stream. It's like a "read only" access.

    If you have any RDBMS experience - it's the exact same idea of "view".

提交回复
热议问题