当前位置:网站首页>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());
}
边栏推荐
- The most detailed swing transformer mask of window attachment in history -- Shaoshuai
- The WebView case of flutter
- 单片机信号发生器程序
- Lightweight digital mall system based on PHP
- [zeloengine] localization process /imgui Chinese culture
- 单片机:I2C通信协议讲解
- 1-72 convert string to decimal integer
- Filter and listener
- Koa file upload and download
- Configuration and practice of shardingsphere JDBC sub database separation of read and write
猜你喜欢

大五人格学习记录
![[test development] file compression project practice](/img/4f/3bbbde5953f8d97bbe4460c63f13c7.png)
[test development] file compression project practice

Goframe day 5

Alipay native components (hotel time selection)

Unity shader learning 004 shader debugging platform difference third-party debugging tools

Lightweight digital mall system based on PHP

单片机:I2C通信协议讲解

leetcode.1 --- 两数之和

Introduction and use of ES6
![[test development] automated test selenium (II) -- common APIs for webdriver](/img/d5/bc38f0bee98b137abc1197c6e03158.png)
[test development] automated test selenium (II) -- common APIs for webdriver
随机推荐
单片机:Modbus 通信协议介绍
高等数学(第七版)同济大学 习题1-3 个人解答
[Yugong series] June 2022 Net architecture class 081 API customization task of distributed middleware schedulemaster
Unity Shader 学习 004-Shader 调试 平台差异性 第三方调试工具
[notes] summarize common horizontal and vertical centering methods
Lambda end operation find and match allmatch
大疆无人机飞控系统的原理、组成及各传感器的作用
Single chip microcomputer: main index of a/d (analog-to-digital conversion)
十億數據量 判斷元素是否存在
Summary of meeting between president Ren and scientists and experts in system engineering
EIA map making - data processing + map making
Differences and relations between three-tier architecture and MVC
Intervention analysis + pseudo regression
[笔记]vs2015 编写汇编masm32之使用MASM32库
单片机信号发生器程序
Real time requirements for 5g China Unicom repeater network management protocol
Lambda end operation find and match findany
MCU: NEC protocol infrared remote controller
1-72 convert string to decimal integer
LVS 4 - tier Load Balancing Cluster (3) Cluster Function Classification - HPC