How to use Stream empty() method in java 8




Asked on October 08, 2016
How to use Stream empty() method in java 8?


Replied on October 08, 2016
According to java doc

static <T> Stream<T> empty()

Returns an empty sequential Stream.

We can use in our code as follows

Stream<Integer> intStream = Stream.empty();
Stream<String> strStream = Stream.empty();




Write Answer












©2024 concretepage.com | Privacy Policy | Contact Us