Section 17.3.6 Creating Streams of ints with IntStream Methods range and rangeClosed

IntStream methods range (p. 743) and rangeClosed each produce an ordered sequence of int values. Both methods take two int arguments representing the range of values. Method range produces a sequence of values from its first argument up to, but not including, its second argument. Method rangeClosed produces a sequence of values including both of its arguments.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.