IntStream range() in Java Last Updated : 06 Dec, 2018 Comments Improve Suggest changes Like Article Like Report IntStream range(int startInclusive, int endExclusive) returns a sequential ordered IntStream from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step of 1. Syntax : static IntStream range(int startInclusive, int endExclusive) Parameters : IntStream : A sequence of primitive int-valued elements. startInclusive : The inclusive initial value. endExclusive : The exclusive upper bound. Return Value : A sequential IntStream for the range of int elements. Example : Java // Implementation of IntStream range // (int startInclusive, int endExclusive) import java.util.*; import java.util.stream.IntStream; class GFG { // Driver code public static void main(String[] args) { // Creating an IntStream IntStream stream = IntStream.range(6, 10); // Displaying the elements in range // including the lower bound but // excluding the upper bound stream.forEach(System.out::println); } } Output: 6 7 8 9 Note : IntStream range(int startInclusive, int endExclusive) basically works like a for loop. An equivalent sequence of increasing values can be produced sequentially as : for (int i = startInclusive; i < endExclusive ; i++) { ... ... ... } Comment More infoAdvertise with us Next Article IntStream range() in Java S Sahil_Bansall Follow Improve Article Tags : Misc Java Java - util package Java-Functions java-stream java-intstream +2 More Practice Tags : JavaMisc Similar Reads IntStream max() in Java with examples java.util.stream.IntStream in Java 8, deals with primitive ints. It helps to solve the problems like finding maximum value in array, finding minimum value in array, sum of all elements in array, and average of all values in array in a new way. IntStream max() returns an OptionalInt describing the ma 2 min read IntStream min() in Java with Examples java.util.stream.IntStream in Java 8, deals with primitive ints. It helps to solve the old problems like finding maximum value in array, finding minimum value in array, sum of all elements in array, and average of all values in array in a new way. IntStream min() returns an OptionalInt describing th 2 min read IntStream count() in Java with examples IntStream count() returns the count of elements in the stream. IntStream count() is present in java.util.stream.IntStream Syntax : long count() Example 1 : Count the elements in IntStream. Java // Java code for IntStream count() // to count the number of elements in // given stream import java.util. 2 min read EnumSet range() Method in Java The EnumSet.range() method is a part of the java.util package. This method is used to create an EnumSet that contains all enum constants between the specified start and end points, and it should be inclusive. It easily creates a subset of enum constants within a specified range.Syntax of EnumSet ran 2 min read Range Class | Guava | Java Guavaâs Range represents an interval, for example, a < range < b. Here range includes any value between a and b, called endpoints which form the boundary. Any value between the boundary is a contiguous span of values of type Comparable. Declaration : The declaration for com.google.common.colle 5 min read Like