LongStream boxed() returns a Stream consisting of the elements of this stream, each boxed to a Long.
Note : LongStream 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.
- Long : The Long class wraps a value of the primitive type long in an object. An object of type Long contains a single field whose type is long.
Return Value : The function returns a Stream boxed to a Long.
Example 1 :
3 4 5 6 7
Example 2 :
3 4 5 6 7 Geeks for Geeks
- IntStream boxed() in Java
- DoubleStream boxed() in Java with Examples
- Program to convert Boxed Array to Stream in Java
- LongStream sum() in Java
- LongStream of() in Java
- LongStream concat() in Java
- LongStream max() in Java with examples
- LongStream min() in Java with examples
- LongStream limit() in Java
- LongStream parallel() in Java
- LongStream rangeClosed() in Java
- LongStream summaryStatistics() in Java
- LongStream sorted() in Java
- LongStream skip() in Java
- LongStream sequential() in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.