Stream empty()
creates an empty sequential Stream.
empty
has the following syntax.
static <T> Stream<T> empty()
The following example shows how to use empty
.
import java.util.stream.Stream; /* ww w. j ava 2 s . c o m*/ public class Main { public static void main(String[] args) { Stream<String> s = Stream.empty(); s.limit(10) .forEach(System.out::println); } }