IntStream boxed() returns a Stream consisting of the elements of this stream, each boxed to an Integer.
Note : IntStream 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.
- Integer : The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int.
Return Value : The function returns a Stream boxed to an Integer.
Example 1 :
3 4 5 6 7
Example 2 :
3 4 5 6 7 Geeks for Geeks
- LongStream boxed() in Java
- DoubleStream boxed() in Java with Examples
- Program to convert Boxed Array to Stream in Java
- IntStream of() in Java
- IntStream sum() in Java
- IntStream builder() in Java
- IntStream max() in Java with examples
- IntStream concat() in Java
- IntStream mapToDouble() in Java
- IntStream min() in Java with Examples
- IntStream skip() in Java
- IntStream mapToObj() in Java
- IntStream iterator() in Java
- IntStream rangeClosed() in Java
- IntStream findFirst() 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 email@example.com. 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.