LongStream empty() in Java with examples
LongStream empty() is a method in java.util.stream.LongStream. This method returns an empty sequential LongStream.
Syntax :
static LongStream empty()
Parameters :
- LongStream : A sequence of primitive long-valued elements.
Return Value : An empty sequential LongStream.
Example 1 : Creating empty LongStream.
// Java code for LongStream empty() import java.util.*; import java.util.stream.LongStream; class GFG { // Driver code public static void main(String[] args) { // creating an empty LongStream, a sequence of // primitive long-valued elements LongStream stream = LongStream.empty(); // Displaying an empty sequential stream System.out.println(stream.count()); } } |
chevron_right
filter_none
Output :
0
Recommended Posts:
- LongStream max() in Java with examples
- LongStream min() in Java with examples
- LongStream allMatch() in Java with examples
- LongStream mapToInt() in Java with Examples
- LongStream anyMatch() in Java with examples
- LongStream count() in Java with examples
- LongStream filter() in Java with examples
- LongStream average() in Java with Examples
- LongStream distinct() in Java with examples
- LongStream peek() in Java with examples
- LongStream noneMatch() in Java with examples
- LongStream reduce(long identity, LongBinaryOperator op) in Java with Examples
- IntStream empty() in Java with examples
- DoubleStream empty() in Java with examples
- Stream empty() in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



