LongStream asDoubleStream() returns a DoubleStream consisting of the elements of this stream, converted to double. This is an intermediate operation. Intermediate operations are invoked on a Stream instance and after they finish their processing, they give a Stream instance as output.
DoubleStream asDoubleStream() Where, DoubleStream is a sequence of primitive double-valued element.
Return Value : LongStream asDoubleStream() returns a DoubleStream consisting of the elements of this stream, converted to double.
Example 1 :
3.0 5.0 9.0 12.0 14.0
Example 2 :
3.0 4.0 5.0 6.0 7.0
Example 3 :
3 3.0 4 4.0 5 5.0 6 6.0 7 7.0
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.