目录标题
《Java8 实战》读书笔记
第 4 章 引入流
[Q&A] java8 流到底是什么呢?
[Q&A] java8 流操作分类
[Q&A] java8 流与集合的区别?
第 5 章 使用流
基础方法
构建流 (Stream.empty()
)、 (Stream.of
)、 (Arrays.stream
)、 (list.stream()
)、 (IntStream.range(0, SENTENCE.length()).mapToObj(SENTENCE::charAt)
)、 (Files.lines
)、 (Stream.iterate
)、 (Stream.generate
)、
筛选(filter
)(distinct
)
切片(limit
)(skip
)
映射(map
,flatMap
)
查找(findAny
)(findFirst
)
匹配(anyMatch
)(allMatch
)(noneMatch
)
归约(reduce
)
Java8使用流样例练习
性能向上
第 6 章 用流收集数据
实践总结
[实践总结] 展平嵌套数组
[实践总结] 集合根据元素属性去重
[实践总结] (String
,int
,Integer
) 互转 (String
、char[]
)互转
[实践总结] (String
,String[]
,List<String>
)互转
[实践总结] (String
,int[]
,Integer[]
,List<Integer>
)互转
[实践总结] List
→分组映射→ Map
并行流
函数式接口、Lambda、Optional
函数式接口 Consumer
、Supplier
、Predicate
、Function
、Comparator
什么是Lambda
表达式?
[实践总结] Optional
常见用法(empty
,of
,ofNullable
)(filter
)(ifPresent
,get
)(map
,flatMap
)(orElse
)(orElseGet
)(orElseThrow
)
[实践总结] java8 Interface
引入新特性( static method
)(default method
)