当前位置:网站首页>Introduction to intstream API
Introduction to intstream API
2022-06-25 04:24:00 【It's hard not to write code all day】
1 establish int Type array
import java.util.stream.IntStream;
IntStream range = IntStream.range(0, 10);
2 boxed()
boxed It's always been mapToObject(Integer::vaueOf)
The elements in the collection are of reference type , Basic data types need to be boxed , To become list
IntStream.range(0,10).boxed().collect(Collectors.toList());
3 mapToDouble()
These three methods return three specified types of stream Other use methods and functions besides map similar , amount to map A special case of the method .
list.stream().mapToDouble(User::getAge).sum()// and
list.stream().mapToDouble(User::getAge).max()// Maximum
list.stream().mapToDouble(User::getAge).min()// Minimum
list.stream().mapToDouble(User::getAge).average()// Average
边栏推荐
- Development of trading system (x) -- fix agreement
- Development of trading system (VII) -- Analysis of trading delay
- numpy np tips:使用opencv对数组插值放缩到固定形状 cv2.resize(res, dsize=(64, 64), interpolation=cv2.INTER_CUBIC)
- Finereport (sail soft) handling the problem that the histogram data label is blocked
- Development of trading system (VIII) -- Construction of low delay network
- 【openwrt】推荐一个国内开发的openwrt的版本,iStoreOS简介,非常好用,主要是做了一些优化。解决了汉化的问题。
- 智慧风电:数字孪生 3D 风机智能设备运维
- Leetcode points to the leetcode road of offering II 091 house painting [dynamic planning] heroding
- Hello CTP (III) - CTP quotation API
- “语法糖”——我的编程新知
猜你喜欢
"Comment positionner l'industrie" dans la planification industrielle locale / parc
讲座记录《捷联惯导解算的历史及发展》
Development of trading system (V) -- Introduction to Sinovel counter
acmStreamOpen返回值问题
论文阅读《LSD-SLAM: Large-Scale Direct Monocular SLAM》
代錶多樣性的彩色 NFT 系列上線 The Sandbox 市場平臺
2. play the chromatic harmonica
How to use ide to automatically sign and debug Hongmeng application
1280_C语言求两个无符号整形的平均值
[team learning] SQL programming language notes - task04
随机推荐
论文阅读《LSD-SLAM: Large-Scale Direct Monocular SLAM》
Development of trading system (VIII) -- Construction of low delay network
数字时代的“文艺复兴”?起底数字藏品,让人欢喜让人愁
【LeetCode】143. Rearrange linked list
Cesium graphic annotation circle, square, polygon, ellipse, etc
"Renaissance" in the digital age? The bottom digital collection makes people happy and sad
cesium 图形标注圆形、正方形、多边形、椭圆等
1、项目第二阶段——用户注册和登陆
numpy np tips: numpy数组的squeeze等处理
openmmlab-环境配置
"Grammar sugar" -- my new programming knowledge
Where is the red area of OpenCV?
【Kubernetes系列】Helm的安装使用
Laravel document sorting 10. Request life cycle
Flutter FittedBox组件
【openwrt】推荐一个国内开发的openwrt的版本,iStoreOS简介,非常好用,主要是做了一些优化。解决了汉化的问题。
PHP code audit 1 - php Ini
Watch out for the stolen face! So many risks of face recognition used every day?
【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示
Color NFT series representing diversity launched on the sandbox market platform