DoubleStream parallel() is a method in java.util.stream.DoubleStream. This method returns a parallel DoubleStream, i.e, it may return itself, either because the stream was already present, or because the underlying stream state was modified to be parallel.
DoubleStream parallel() is an intermediate operation. These operations are always lazy. Intermediate operations are invoked on a Stream instance and after they finish their processing, they give a Stream instance as output.
DoubleStream parallel() Where, DoubleStream is a sequence of primitive double-valued elements and the function returns a parallel DoubleStream.
Example 1 :
The corresponding parallel DoubleStream is : 4.5 7.8 12.6 5.2
Example 2 :
The corresponding sequential DoubleStream is : 5.2 12.6 4.5 7.8
Example 3 :
The sorted parallel DoubleStream is : 4.5 6.6 2.3 3.0
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- DoubleStream.Builder build() in Java
- DoubleStream generate() method in Java
- DoubleStream forEach() method in Java
- DoubleStream forEachOrdered() method in Java
- DoubleStream sorted() in Java
- DoubleStream flatMap(DoubleFunction mapper) in Java
- DoubleStream summaryStatistics() in Java
- DoubleStream noneMatch() in Java with examples
- DoubleStream sum() in Java
- DoubleStream distinct() in Java with examples
- DoubleStream count() in Java with examples
- DoubleStream min() in Java with examples
- DoubleStream max() in Java with examples
- DoubleStream average() in Java with Examples
- DoubleStream filter() in Java with examples
- DoubleStream empty() in Java with examples
- DoubleStream skip() in Java
- DoubleStream iterator() in Java
- DoubleStream map(DoubleUnaryOperator mapper) in Java
- DoubleStream of() in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.