Page 1 of 1
About Question enthuware.ocpjp.v8.2.1872 :
Posted: Wed Feb 27, 2019 2:14 pm
by crazymind
In solution of question 33, it says
"Manipulating a stream doesn't manipulate the backing source of the stream. "
But why does setPrice change the original list? Thanks
Re: About Question enthuware.ocpjp.v8.2.1872 :
Posted: Wed Feb 27, 2019 6:31 pm
by admin
Stream and an object in that stream are two different things. New stream doesn't contain clones of the objects in the original stream.
Re: About Question enthuware.ocpjp.v8.2.1872 :
Posted: Sun Feb 05, 2023 3:14 pm
by robhun79
I thought that this would throw an exception at runtime because we are calling a terminal operation twice on the same stream but am i correct now in thinking that this is two streams because by calling books.stream() for the second time we are getting a different stream? Thanks!
Re: About Question enthuware.ocpjp.v8.2.1872 :
Posted: Tue Feb 07, 2023 10:35 am
by admin
That is correct.