But why does setPrice change the original list? Thanks"Manipulating a stream doesn't manipulate the backing source of the stream. "
About Question enthuware.ocpjp.v8.2.1872 :
Moderator: admin
-
- Posts: 85
- Joined: Mon Dec 24, 2018 6:24 pm
- Contact:
About Question enthuware.ocpjp.v8.2.1872 :
In solution of question 33, it says
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1872 :
Stream and an object in that stream are two different things. New stream doesn't contain clones of the objects in the original stream.
-
- Posts: 9
- Joined: Thu Feb 02, 2023 12:18 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1872 :
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!
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1872 :
That is correct.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests