The parallelStream method is executed concurrently, which is equivalent to turning on the thread to output sout. The reason why there is no output is that the main thread has finished executing, and the sub-thread has finished. There is no soout at this time. Add a wait at the end of the code and you can see the effect
The parallelStream method is executed concurrently, which is equivalent to turning on the thread to output sout.
The reason why there is no output is that the main thread has finished executing, and the sub-thread has finished. There is no soout at this time. Add a wait at the end of the code and you can see the effect
parallel...What is this method used for?
The answer on the second floor is very good
It is equivalent to opening n+ threads instead of n