- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
DoubleStream parallel() method in Java
The parallel() method of the DoubleStream class returns an equivalent stream which is parallel.
The syntax is as follows
DoubleStream parallel()
To use the DoubleStream class in Java, import the following package
import java.util.stream.DoubleStream;
The following is an example to implement DoubleStream parallel() method in Java
Example
import java.util.*; import java.util.stream.DoubleStream; public class Demo { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(35.8, 14.9, 23.3, 67.8, 89.4, 45.6); System.out.println("Parallel DoubleStream = "); doubleStream.parallel().forEach(System.out::println); } }
Output
Parallel DoubleStream = 67.8 14.9 23.3 89.4 45.6 35.8
Advertisements