IntStream empty() is a method in java.util.stream.IntStream. This method returns an empty sequential IntStream.
static <T> Stream<T> empty() Where, T is the type of stream elements, and the function returns an empty sequential stream.
Example 1 : Creating empty IntStream.
Example 2 : Creating empty LongStream.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.