1.

Explain The Use Of Takewhile Method In Stream?

Answer»

takeWhile METHOD takes all the values until the predicate returns false. It returns, in CASE of ordered stream, a stream CONSISTING of the longest PREFIX of ELEMENTS taken from this stream matching the given predicate.

takeWhile method takes all the values until the predicate returns false. It returns, in case of ordered stream, a stream consisting of the longest prefix of elements taken from this stream matching the given predicate.



Discussion

No Comment Found