JDK8新特性☞Function测试
来源:互联网 发布:传奇盛世翅膀8升9数据 编辑:程序博客网 时间:2024/04/28 23:40
/**
* JDK8新特性☞Function接口测试 Function接口有一个参数并且返回一个结果,并附带一些和其他函数组合的默认方法
*
* @author Administrator
*
*/
public class Test1 {
public static void main(String[] args) {
Function<Integer, String> function = String::valueOf;
Function<Integer, Integer> then = function.andThen(Integer::valueOf);
Integer apply = then.apply(123);
System.out.println(apply);
}
* JDK8新特性☞Function接口测试 Function接口有一个参数并且返回一个结果,并附带一些和其他函数组合的默认方法
*
* @author Administrator
*
*/
public class Test1 {
public static void main(String[] args) {
Function<Integer, String> function = String::valueOf;
Function<Integer, Integer> then = function.andThen(Integer::valueOf);
Integer apply = then.apply(123);
System.out.println(apply);
}
}
测试结果
123
阅读全文
0 0
- JDK8新特性☞Function测试
- JDK8新特性☞测试Predicate接口
- JDK8新特性☞Optional测试
- JDK8新特性☞Stream接口测试
- JDK8新特性☞Date接口测试
- JDK8新特性☞访问局部变量测试
- JDK8新特性☞接口Supplier||Consumer||Compator测试
- jdk8新特性
- JDK7、JDK8新特性
- JDK8新特性
- JDK8新特性-Lambda
- JDK8新特性-Stream
- JDK8新特性
- JDK8新特性
- jdk8新特性
- JDK8新特性--Stream
- JDK8新特性
- jdk8 新特性
- 极光推送
- Promise是Monad吗?
- 复习UITableViewCell
- codeforces 817D Imbalanced Array(单调栈)
- AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'legacy_seq2s eq'
- JDK8新特性☞Function测试
- python 函数编程
- libevent入门
- Java基础学习笔记 第一部分 part 3
- 贪心算法的证明(贪心策略是安全的)
- libvlc外部api的简单整理
- 自定义完成一个日历(一)
- Ubuntu16 编译源码出错 unsupported reloc 43
- Codeforces Anton and Letters