美文网首页
第 44 条:坚持使用标准的函数接口

第 44 条:坚持使用标准的函数接口

作者: 综合楼 | 来源:发表于2021-05-22 10:20 被阅读0次
坚持使用标准的函数接口.jpeg
Interface Function Signature Example
UnaryOperator T apply(T t) String::toLowerCase
BinaryOperator T apply(T t1, T t2) BigInteger::add
Predicate boolean test(T t) Collection::isEmpty
Function R apply(T t) Arrays::asList
Supplier T get() Instant::now
Consumer void accept(T t) System.out::println

相关文章

网友评论

      本文标题:第 44 条:坚持使用标准的函数接口

      本文链接:https://www.haomeiwen.com/subject/lujwdltx.html