Hi,
Please can you kindly help clarify this question. (Please see attached).
Explanation ended up saying a count of 3 is printed and that was what I chose but the right answer is chosen as 3573
About Question enthuware.ocpjp.v11.2.3324 :
Moderator: admin
-
- Posts: 1
- Joined: Mon Mar 29, 2021 6:48 am
- Contact:
About Question enthuware.ocpjp.v11.2.3324 :
- Attachments
-
- Test1 Question 29.png (162.72 KiB) Viewed 2613 times
-
- Site Admin
- Posts: 10064
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3324 :
Actually, the explanation does contain a note about the peek method, which is what is generating the first 357 in the output.
Explanation has now been enhanced to make it more clear.
Explanation has now been enhanced to make it more clear.
thank you for your feedback!Observe the invocation of the peek method in the stream pipeline. The peek method does not remove any element from the stream. It simply performs the given operation (System.out.print, in this case) for each of the elements (which prints 3, 5, and 7). The resulting stream contains the same elements as the original stream on which peek is invoked.
Finally, count returns 3, which is printed by the last println statement. Thus, the output is 3537.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Wed Apr 21, 2021 2:49 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3324 :
At the end of the explanation, "Thus, the output is 3537" should be "Thus, the output is 3573"
-
- Site Admin
- Posts: 10064
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3324 :
Right! Fixed.
thank you for your feedback!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 109 guests