In Java 8,
java.util.stream.IntStream was introduced to deal with primitive ints.
IntStream.range returns a sequential
IntStream for the range
int elements. The
first parameter is inclusive while the
second parameter is exclusive. Looking at this example, it will
include 1 but NOT include 3.
Integral primitive streams (
LongStream) have a
The difference between
is that the second parameter is inclusive instead of
exclusive. Looking at the following example, it will add to stream 1, 2, and 3.