Java lamada:IntStream
--range(int startInclusive, int endExclusive):前包后不包
代码语言:javascript复制IntStream.range(0, 10).forEach(System.out::print);
输出:0123456789
--rangeClosed(int startInclusive, int endInclusive):前后全包
代码语言:javascript复制IntStream.rangeClosed(0, 10).forEach(System.out::print);
输出:012345678910
同样 LongStream