DoubleStream boxed() returns a Stream consisting of the elements of this stream, each boxed to a Double.
Note : DoubleStream boxed() is a intermediate operation. These operations are always lazy. Intermediate operations are invoked on a Stream instance and after they finish their processing, they give a Stream instance as output.
- Stream : A sequence of elements supporting sequential and parallel aggregate operations.
- Double : The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double.
Return Value : The function returns a Stream boxed to a Double.
Example 1 :
3.2 8.4 3.6 4.7
Example 2 :
3.2 8.4 3.6 4.7 Geeks for Geeks
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.