当前位置:网站首页>Lambda终结操作count
Lambda终结操作count
2022-06-13 03:35:00 【Leon_Jinhai_Sun】
count
可以用来获取当前流中元素的个数。
例子:
打印这些作家的所出书籍的数目,注意删除重复元素。
// 打印这些作家的所出书籍的数目,注意删除重复元素。
List<Author> authors = getAuthors();
long count = authors.stream()
.flatMap(author -> author.getBooks().stream())
.distinct()
.count();
System.out.println(count);
边栏推荐
- MySQL learning summary XIII: detailed explanation of if, case, loop, while & cursor of process control
- Azure SQL db/dw series (13) -- using query store (2) -- report Introduction (2)
- Doris data import broker load
- Complete set of Stata code commands: follow and verify do files, common Stata commands, code collection, panel entropy method
- LVS four layer load balancing cluster (4) main methods of load balancing
- LVS四层负载均衡集群(4)负载均衡的主要方式
- 【测试开发】软件测试基础篇
- Getting started with Oracle
- MASA Auth - SSO與Identity設計
- Advanced API review
猜你喜欢
Simulink代码生成: 查表模块及其代码
Peking University HP financial index - matching enterprise green innovation index 2011-2020: enterprise name, year, industry classification and other multi indicator data
MASA Auth - SSO與Identity設計
Masa Auth - SSO and Identity Design
【测试开发】测试管理工具禅道的安装
[azure data platform] ETL tool (1) -- Introduction to azure data factory
基于华为云物联网设计的浇花神器(STM32+ESP8266)
LVS四层负载均衡集群(4)负载均衡的主要方式
(九)详解广播机制
【youcans 的 OpenCV 例程200篇】201. 图像的颜色空间转换
随机推荐
Alipay open platform
Azure SQL db/dw series (11) -- re understanding the query store (4) -- Query store maintenance
Window and various windowfunctions in Flink
MapReduce internal execution principle
Doris data aggregation
footstep
Coal industry database - coal price, consumption, power generation & Provincial Civil and industrial power consumption data
在JDBC连接数据库时报错:Connection to 139.9.130.37:15400 refused.
LeetCode185. All employees with the top three highest wages in the Department (MySQL)
MySQL learning summary Xi: detailed explanation of the use of stored procedures and stored functions
[200 opencv routines by youcans] 201 Color space conversion of images
MySQL 8.0 enables remote root user access and solves the problem of you are not allowed to create a user with Grant
Use of Oracle PL-SQL
[test development] blog system - LoadRunner performance test (publish blog function benchmark test)
Watering artifact based on Huawei cloud Internet of things (stm32+esp8266)
Wechat payment configuration
MySQL learning summary XIII: detailed explanation of if, case, loop, while & cursor of process control
【测试开发】进阶篇——各种测试技术分类
Alibaba cloud keep on record
Workflow of driver of spark kernel (stage division, task division, task scheduling)