Java DoubleStream create from random double value
import java.util.Random; import java.util.stream.DoubleStream; public class Main { public static void main(String[] args) { DoubleStream.generate(new Random()::nextDouble) .limit(10)/*from w ww . ja va 2 s .c o m*/ .forEach(System.out::println); } }