当前位置:网站首页>There are three ways to traverse the map. Second, you know
There are three ways to traverse the map. Second, you know
2022-06-22 09:13:00 【C_ x_ three hundred and thirty】
package com.Cx_330.run;
import org.junit.Test;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Consumer;
public class CCC {
public static void main(String[] args) {
HashMap<Integer, String> map = new HashMap<>();
map.put(1," Zhang San ");
map.put(2," Zhang Xiaosan ");
map.put(3," Zhangsanxiao ");
map.put(4," Xiao Zhang San ");
map.put(5," Three Xiaozhang ");
Set<Integer> integers = map.keySet();
for (Integer i:integers){
System.out.println(" key : "+i+" value : "+map.get(i));
}
System.out.println("------------------------");
Set<Map.Entry<Integer, String>> mp2 = map.entrySet();
for (Map.Entry<Integer, String> x:mp2){
System.out.println(" key : "+x.getKey()+" value : "+x.getValue());
}
System.out.println("------------------------");
map.forEach((k,v)->System.out.println(" key : "+k+" value : "+v));
}
}
边栏推荐
猜你喜欢

Threejs implementation of simple panoramic view demo

【node】理论+实践让你拿下session、cookie
![Local visualization method of xshell remote server tensorboard/visdom [one-step test is effective]](/img/42/6f5121c472e25990df98c2b119b8c9.png)
Local visualization method of xshell remote server tensorboard/visdom [one-step test is effective]

Solidity from introduction to practice (V)

医疗信息管理系统数据库--MySQL

Solidity from introduction to practice (II)
![Ten ways to write ABC by three different threads [concurrent programming JUC]](/img/81/37523bada219fa54eab5a0dffb5a9c.jpg)
Ten ways to write ABC by three different threads [concurrent programming JUC]

滴滴二面总结

Manually mining XSS vulnerabilities

Navicat for MySQL连接MySQL数据库时各种错误解决
随机推荐
一学就会的tensorflow断点续训(原理+代码详解)
[detailed explanation] point multiplication and cross multiplication of neural network matrix (pytorch version)
Local visualization method of xshell remote server tensorboard/visdom [one-step test is effective]
集合中的类--->你关注过那些是线程安全的吗?
Wireless routing attack and WiFi password cracking practice [penetration technology]
Troubleshooting various errors when Navicat for MySQL connects to MySQL database
Map三种遍历方式,秒懂,你懂
项目优化+上线(掌握了么?)
Express bird of Express query demonstration code (php+curl)
Final典型案例
Solidity from introduction to practice (IV)
DOM programming
simple_strtoull字符转换相关函数
Share 830 spider IP segments (by analyzing 1g logs)
. A use of file link library
[qnx hypervisor 2.2 user manual]5.6 close guest
【node】脚手架搭建服务器,完成token验证
User insight into the video industry in January 2022: active users began to pick up under the influence of holidays
The dream of "getting rich overnight" is broken. Beware of virtual currency investment scams!!!
Threejs implementation of simple panoramic view demo