Java IntStream range()
IntStream range(int startInclusive, int endExclusive) 返回一个从startInclusive(包容)到endExclusive(排他)的连续有序的IntStream,增量为1。
语法
参数
- IntStream : 一个原始int值元素的序列。
- startInclusive : 包容性初始值。
- endExclusive : 排他性的上界。
返回值: 一个序列IntStream的int元素的范围。
例子。
输出。
注意: IntStream range(int startInclusive, int endExclusive)基本上像一个for循环一样工作。一个等价的递增值序列可以依次产生为: