当前位置:网站首页>Use lamda expression and stream flow to traverse map and list
Use lamda expression and stream flow to traverse map and list
2022-06-27 17:32:00 【Flying page】
List<String> list = new ArrayList<String>();
Map<String,String> map = new HashMap<>();
map.put("id","11");
map.put("name","zhangsan");
map.put("age","30");
// Traverse map aggregate
map.forEach((k,v) -> list.add(v));
// These Traversals list The methods of a collection can
list.stream().forEach(System.out::println);
list.stream().forEach(e-> System.out.println(e));
list.forEach(e-> System.out.println(e));
边栏推荐
- P. Simple application of a.r.a method in Siyuan (friendly testing)
- Related configuration commands of Huawei LACP
- C language teacher workload management system
- Alibaba cloud server is invaded
- Autodesk NavisWorks 2022 software installation package download and installation tutorial
- Raspberry pie preliminary use
- Explain the distributed computing of Apache skywalking OAP in detail
- Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately
- How much room does Migu video have for development without relying on sports events?
- Oracle概念二
猜你喜欢

CDH cluster installation

Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)

全面解析零知识证明:消解扩容难题 重新定义「隐私安全」

软件测试基础-软件测试历史流程,分类,好处,限制

Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)

智慧风电 | 图扑软件数字孪生风机设备,3D 可视化智能运维

Drawing for example study of flashcc

d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download

Unity 阴影——阴影平坠(Shadow pancaking)

Overview of Inspur Yunxi database executor
随机推荐
When the publish / subscribe mode encounters NET
d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
C语言教师工作量管理系统
C language set operation
Annual comprehensive analysis of China's audio market in 2022
JXL export Excel
LeetCode 124. Binary tree maximum path sum - binary tree series question 8
leetcode 142. Circular linked list II
428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
P. Simple application of a.r.a method in Siyuan (friendly testing)
【牛客刷题】NowCoder号称自己已经记住了1-100000之间所有的斐波那契数。 为了考验他,我们随便出一个数n,让他说出第n个斐波那契数。如果第n个斐波那契大于6位则只取后6位。
How to write a resume?
Cloud security daily 220216: root privilege escalation vulnerability found on IBM SaaS integration platform needs to be upgraded as soon as possible
What is RPC
Mihayou sued Minmetals trust, which was exposed to product thunderstorms
Detailed explanation of transaction isolation level
软件测试-测试的概念,单元测试的详细介绍,如何设计测试用例
Oracle概念二
National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
d3dx9_ What if 27.dll is lost? d3dx9_ How to repair 27.dll?