当前位置:网站首页>Common ways to traverse map sets
Common ways to traverse map sets
2022-06-13 04:06:00 【Cavewang】
Map A set is a key value pair that stores values , So traverse Map A collection is a collection of keys and values .
1. adopt map.keySet() Get value , Then get the value according to the key
for(String s:map.keySet()){
System.out.println("key : "+s+" value : "+map.get(s));
}
2. take map adopt entrySet Method to set, Then go through it ( The more commonly used )
for(Map.Entry<String, String> entry : map.entrySet()){
System.out.println("key :"+entry.getKey()+" value :"+entry.getValue());
}
边栏推荐
- [notes] summarize common horizontal and vertical centering methods
- 5g China Unicom ap:b SMS ASCII transcoding requirements
- Advanced Mathematics (Seventh Edition) Tongji University exercises 1-2 personal solutions
- [笔记]vs2015 编写汇编masm32之使用MASM32库
- 高等数学(第七版)同济大学 习题1-3 个人解答
- Et framework -22 creating serverinfo entities and events
- Single chip microcomputer: MODBUS multi computer communication program design
- EGO planner论文翻译
- knife4j aggregation 2.0.9支持路由文档自动刷新
- try-catch finally执行顺序的例题
猜你喜欢
随机推荐
单片机:A/D(模数转换)的主要指标
Advanced Mathematics (Seventh Edition) Tongji University exercises 1-2 personal solutions
JSTL -- JSP standard tag library
Differences and relations between three-tier architecture and MVC
【ZeloEngine】本地化流程/ImGui中文化
Single chip microcomputer: d/a output
Difference between OKR and KPI
MCU: pcf8591 hardware interface
单片机:EEPROM 多字节读写操作时序
Filter and listener
单片机:A/D 差分输入信号
[Yugong series] June 2022 Net architecture class 080 master cluster and database switching of distributed middleware schedulemaster
【LeetCode】860. Change with lemonade (2 brushes for wrong questions)
Lambda termination operation find and match nonematch
Principle and control program of single chip microcomputer serial port communication
Lambda end operation find and match findfirst
Big Five personality learning records
Sword finger offer II 022 Entry node of a link in a linked list
MSG messages in ROS
SQL 进阶挑战(1 - 5)









