Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

LongStream empty() in Java with examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

LongStream empty() is a method in This method returns an empty sequential LongStream.
Syntax :

static LongStream empty() 

Parameters :

  1. 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.*;
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

Output :

My Personal Notes arrow_drop_up
Last Updated : 06 Dec, 2018
Like Article
Save Article
Similar Reads
Related Tutorials