DoubleStream forEachOrdered(DoubleConsumer action) performs an action for each element of this stream in encounter order. DoubleStream forEachOrdered(DoubleConsumer action) is a terminal operation i.e, it may traverse the stream to produce a result or a side-effect.
void forEachOrdered(DoubleConsumer action)
Parameter : DoubleConsumer represents an operation that accepts a single double-valued argument and returns no result. This is the primitive type specialization of Consumer for double.
Note : forEachOrdered(DoubleConsumer action) performs an action for each element of this stream, in the encounter order of the stream if the stream has a defined encounter order.
Example 1 :
2.2 3.3 4.4 5.5
Example 2 :
5.3 6.4 7.3 6.1
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.