長流empty()是java.util.stream.LongStream中的方法。此方法返回空的順序LongStream。
用法:
static LongStream empty()
參數:
- LongStream : 一係列原始long值元素。
返回值:空的連續LongStream。
示例1:創建空的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());
}
}
輸出:
0
相關用法
- Java LongStream min()用法及代碼示例
- Java LongStream max()用法及代碼示例
- Java LongStream distinct()用法及代碼示例
- Java LongStream count()用法及代碼示例
- Java LongStream noneMatch()用法及代碼示例
- Java LongStream allMatch()用法及代碼示例
- Java LongStream mapToInt()用法及代碼示例
- Java LongStream filter()用法及代碼示例
- Java LongStream peek()用法及代碼示例
- Java LongStream anyMatch()用法及代碼示例
- Java LongStream average()用法及代碼示例
- Java LongStream reduce(long identity, LongBinaryOperator op)用法及代碼示例
- Java Stream empty()用法及代碼示例
- Java DoubleStream empty()用法及代碼示例
- Java IntStream empty()用法及代碼示例
注:本文由純淨天空篩選整理自Sahil_Bansall大神的英文原創作品 LongStream empty() in Java with examples。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。