Returns an infinite sequential ordered Stream produced by iterative application of the provided UnaryOperator. The seed is the initial element of the iteration.
Examples
package com.logicbig.example.stream;
import java.util.stream.Stream;
public class IterateExample {
public static void main(String... args) { Stream<Integer> stream = Stream.iterate(0, i -> i + 1) .limit(10); stream.forEach(System.out::println); } }