int mathSumInt = list.stream().mapToInt( Student::getMathScoresInt ).sum(); //int类型 long mathSumLong = list.stream().mapToLong( Student::getMathScoresLong ).sum(); //long类型 double mathSumDouble = list.stream().mapToDouble( Student::getMathScoresDouble
不同数值类型值求和统计
最新推荐文章于 2024-07-10 21:37:49 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)