| |
|
If you wanted to process a stream of names, extract the male names, and store them in a new list, what is the appropriate operation to be used? Question Posted on 07 Jan 2021 Home >> Java >> Java8 Innards >> If you wanted to process a stream of names, extract the male names, and store them in a new list, what is the appropriate operation to be used? |
If you wanted to process a stream of names, extract the male names, and store them in a new list, what is the appropriate operation to be used?
Choose the correct option from below list
(1)Stream.filter
(2)Stream.collect
(3)Stream.reduce
(4)Both Stream.reduce and Stream.collect
Answer:-(2)Stream.collect | |
|
|
|
|