How do you iterate through a range of numbers (0-100) in steps(3) with IntStream?
I tried iterate, but this never stops executing.
iterate
IntS
limit can also be used
limit
int limit = ( 100 / 3 ) + 1; IntStream.iterate(0, n -> n + 3).limit(limit).forEach(System.out::println);