Lambda 自带的匿名函数

简介: Lambda 自带的匿名函数

Lambda 自带的匿名函数
因为匿名函数是要被实现的,因此我们无需关注匿名函数的方法名。只需要关注参数列表和返回值即可。
Predicate boolean test(T t); 参数:T 返回值: boolean ※常用
IntPredicate int->boolean
LongPredicate long->boolean
DoublePredicate double->boolean
Consumer void accept(T t); 参数:T 返回值: void ※常用
IntConsumer int->void
LongConsumer long->void
DoubleConsumer double->void
Function<T, R> R apply(T t); 参数:T 返回值: R (指定类型的参数,指定类型的返回值) ※常用
IntFunction int->R
LongFunction long->R
DoubleFunction double->R
IntToLongFunction int->long
IntToDoubleFunction int->double
LongToIntFunction long->int
LongToDoubleFunction long->double
DoubleToIntFunction double->int
DoubleToLongFunction double->long
Supplier T get(); 参数:无 返回值:T (也有相似的int、long、double接口) ※常用
UnaryOperator 参数:T 返回值:T (也有相似的int、long、double接口)
BiFunction<T, U, R> R apply(T t, U u); 参数:T,U 返回值:R
BinaryOperator extends BiFunction<T,T,T> 参数:T,T 返回值:T
BiPredicate<T, U> boolean test(T t, U u); 参数:T,U,返回值:boolean
BiConsumer<T, U> void accept(T t, U u); 参数:T,U 返回值:void

目录
相关文章
|
9月前
|
存储 编译器 C++
13函数
13函数
36 0
|
9月前
|
存储 编译器 C++
|
9月前
|
程序员 C语言 Python
函数—C(上)
函数—C(上)
65 0
|
存储 C语言
对函数的剖析二
对函数的剖析二
66 0
|
编译器 C语言
C 中的函数
C 中的函数
|
算法 编译器 API
8.函数
8.函数
83 0
javaSprict 03 函数的使用
本文将讲述javaSprict中函数的声明,调用方法
javaSprict 03 函数的使用

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等