Java IntStream limit element number

Description

Java IntStream limit element number


import java.util.stream.IntStream;

public class Main {
  public static void main(String[] args) {
    IntStream.generate(() ->  99)
    .limit(10)// www . j a  v a 2s. com
    .forEach(System.out::println);
  }
}



PreviousNext

Related