ordered Number Stream - Java Lambda Stream

Java examples for Lambda Stream:Stream

Description

ordered Number Stream

Demo Code


    //package com.java2s;

    import java.util.stream.*;

    public class Main {
        public static Stream<Integer> orderedNumberStream(int initialNum, int stepSize, int size) {
  return(Stream.iterate(initialNum, n -> n + stepSize).limit(size));
}
    }//w w w  .  j  a va  2  s . c  o m

Related Tutorials