Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: IntStream.rangeClosed() (was: Re: Inclusive or exclusive array) Date: Wed, 31 Jul 2019 11:33:06 -0000 (UTC) Organization: A noiseless patient Spider Lines: 11 Message-ID: References: <87zhkvmqx8.fsf@munus.decebal.nl> Reply-To: avl@logic.at Injection-Date: Wed, 31 Jul 2019 11:33:06 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="b8438de1153d556f5125f65d4e9081d1"; logging-data="10021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4R4EDGwogd+L9P5pkFh2m" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:xxC8x9nYlenQZPQE2Sa7qg9WkTk= Xref: csiph.com comp.lang.java.programmer:39041 Eric Sosman wrote: > java.util.stream.IntStream::rangeClosed(int, int) Doc says that the sequence is equivalent to the following for loop: for (int i = startInclusive; i <= endInclusive ; i++) { ... } Does that mean in practice that an IntStream.rangeClosed() with Integer.MAX_VALUE given for endInclusive should produce an "infinite" stream of integers, as the for loop would do with such a condition? PS: Apparently it does not. Is the javadoc "imprecise"?