Option B doesn't seem right because the map() method is used to transform the elements, not to filter them. The count() method would return the number of elements that are true, which is not what we want.
I think option A is the correct answer. The stream() method is used to create a stream of the list elements, and the filter() method is used to filter the elements based on the condition x.length() > 3, which gives us the count of the string elements whose length is greater than three.
I think the answer is A) listVal.stream().filter(x -> x.length()>3).count(). Because it filters out the elements with length greater than three and then counts them.
upvoted 0 times
...
Log in to Pass4Success
Sign in:
Report Comment
Is the comment made by USERNAME spam or abusive?
Commenting
In order to participate in the comments you need to be logged-in.
You can sign-up or
login
Stephanie
1 months agoClorinda
6 days agoJonell
20 days agoKeneth
1 months agoLina
2 months agoJesusa
4 days agoCortney
9 days agoCarin
1 months agoShenika
2 months agoJohnetta
16 hours agoRocco
3 days agoYasuko
6 days agoJamal
19 days agoAlpha
28 days agoEdwin
1 months agoNana
1 months agoJanine
2 months agoChu
1 months agoParis
2 months agoVenita
2 months agoElliott
2 months agoRessie
2 months ago