Streams – DoubleStream class
DoubleStream.of(2.4); DoubleStream.of(7.1, 10.5, 12.7); DoubleStream.iterate(0, i -> i + 2).limit(10); DoubleStream.generate(() -> Math.random() * 5).limit(10); class Test { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(1.2, 3.1, 7.2, 5.3, 9.8); doubleStream.forEach(item -> System.out.print(item + ” “)); } } Output: 1.2 3.1 7.2 5.3 9.8 class Test { public static void main(String[] args) {…
Read More Streams – DoubleStream class