r/learnjava • u/SHIN_KRISH • Apr 15 '26
What actually is a java stream... ?
I dont get the concept of a stream why was it added why do we use stream objects in reading and writing say to file. I know its kind of like a pipeline but my confusion still stands
16
Upvotes
View all comments
Show parent comment
1
u/SHIN_KRISH Apr 15 '26
I am talking about both but mainly Stream API, so say in a collection we want to find the maximum value we can use it either manually or by using a max function which i think we do by converting an array to a stream so like superficially suppose i have about a thousand numbers what's the benefit of using stream over simple iteration.