Stream流
时间:2020-03-18 22:26:53
收藏:0
阅读:52
1、是什么
JDK 1.8 用于解决已有集合、数组类库既有的弊端;简化集合和数组的操作;
2、常用API
#过滤
filter
#遍历
foreach
#统计
count
#截取
limit
#跳过
skip
#映射
map
#合并stream流
concat
3、收集流
3.1 把stream转换为Set:
3.2 把stream转换为List:
3.3 把stream转换为Array:
原文:https://www.cnblogs.com/xp2h/p/12520202.html
评论(0)