June 2018
Beginner
722 pages
18h 47m
English
The range(lower, upper) method generates all the values sequentially, starting from the lower value and ending with the value just before upper:
IntStream.range(1, 3).forEach(System.out::print); //prints: 12LongStream.range(1, 3).forEach(System.out::print); //prints: 12
The rangeClosed(lower, upper) method generates all the values sequentially, starting from the lower value and ending with the upper value:
IntStream.rangeClosed(1, 3).forEach(System.out::print); //prints: 123LongStream.rangeClosed(1, 3).forEach(System.out::print); //prints: 123
Read now
Unlock full access