VOOZH about

URL: https://www.geeksforgeeks.org/java/intstream-sequential-java/

⇱ IntStream sequential() in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

IntStream sequential() in Java

Last Updated : 6 Dec, 2018
IntStream sequential() returns a sequential IntStream. It may return itself, either because the stream was already sequential, or because the underlying stream state was modified to be sequential. IntStream sequential() 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. Syntax :
IntStream sequential()

Where, IntStream is a sequence of primitive
int-valued element.
Example 1 :
Output:
3
5
9
12
14
Example 2 :
Output:
-2
-1
0
1
2
3
Comment