Java DoubleStream create from generator

Description

Java DoubleStream create from generator

import java.util.stream.DoubleStream;

public class Main {
  public static void main(String[] args) {
    DoubleStream.generate(() ->  99.99D)
    .limit(10)/*from   w w  w  .  j  a v  a2s.  com*/
    .forEach(System.out::println);
  }
}



PreviousNext

Related