java8玩集合

将集合转为stream流 进行计算编程

1.filter 过滤数组

2.distinct 去重函数式编程

3.skip 跳过函数

4.map 转化指针

5stream转为 Collect   对象

collect(Collectors.toList());

6.reudce 集合  将数组中的元素累加ip

Optional 是 Java 实现函数式编程的强劲一步,而且帮助在范式中实现。io

Optional 类主要解决的问题是臭名昭著的空指针异常(NullPointerException)。stream

Optional 类既能够含有对象也能够为空。List

相关文章
相关标签/搜索