Pawan singh 2022-Feb-01 1 Answers

Answers ( 1 )

  1. Java provides a new  package in Java 8 called java.util.stream. This package consists of classes, interfaces and enum to allows functional-style operations on the elements.Stream can be used by importing java.util.stream package.

    Stream does not modify actual source rather it produces stream of elements out of that source and perform action on it like filtering data , mapping data , printing and converting to different data structures etc.

    The elements of a stream are only visited once during the life of a stream. Like an Iterator, a new stream must be generated to revisit the same elements of the source.

    0 Comment Add Comment/ View

Leave an answer

Logged in as