Join the Community Java Q&A

Tag: forEachOrdered

java8 – forEach vs forEachOrdered

With Java8 streams, we take the advantage of parallelism on multi core processor. Java8 has introduced forEach() forEachOrdered() on collections to iterate over a stream of elements, however there is a difference between the two methods. Quoting from Javadoc: The …