142k views
5 votes
An infinite stream is a stream for which successive exposures always return values.

a. True
b. False

User Begray
by
4.9k points

1 Answer

4 votes

Answer:

True

Step-by-step explanation:

Infinite sequential ordered stream return values as the first element are at position 0 in the stream and provided seed. The n > 0 is the element at the position and will result for applying functions f at position n.

Infinite Instream is creating a stream of even numbers that start from 0.

Such as

List<Integer> ints = InStream. iterate(0,i-> i +2)

.mapToObj(Integer:: valueOf)

.limit(10)

.collect(Collectors.tolist());

system.out.printin(ints);

It returns an infinite unordered stream, and the Supplier generates each. The limit() method can be called in the stream to stop the series after several elements.

User Bitsplitter
by
5.7k points