LongStream iterator()
returns iterator for LongStream.
iterator
has the following syntax.
PrimitiveIterator.OfLong iterator()
The following example shows how to use iterator
.
import java.util.PrimitiveIterator; import java.util.stream.LongStream; /*from w w w . j av a2s . c om*/ public class Main { public static void main(String[] args) { LongStream b = LongStream.empty(); PrimitiveIterator.OfLong o = b.iterator(); while(o.hasNext()){ System.out.println(o.next()); } } }