当前位置:网站首页>map去重代码实现
map去重代码实现
2022-08-09 09:17:00 【我是不贪嘴吖】
对map去重的了解
代码实现
public static void main(String[] arg){
Map<String,String> map = new HashMap<>();
map.put("11","22");
map.put("22","22");
map.put("33","33");
map.put("44","44");
System.out.println("去重前" + map.toString());
Map<String,String> map1 = new HashMap(String,String);
for(String key :map.get(key)){
if(!map1.containsValue(map.get(key)){
map1.put(key,map.get(key));
}
System.out.println("去重后" + map1.toString());
边栏推荐
- Global 19 Google Satellite Map Free View Download
- Anaconda4.8.3介绍、安装及使用教程安装(win10)并修改Jupyter默认工作目录
- on duplicate key update
- 【培训课程专用】Secureboot
- MySQL Leak Detection and Filling (2) Sorting and Retrieval, Filtering Data, Fuzzy Query, Regular Expression
- 软件测试面试常见问题及答案(发散思维、接口、性能、概念、)
- 常用SQL server语句
- 接口性能测试方案设计方法有哪些?要怎么去写?
- Web请求原理
- 软件测试的流程规范有哪些?具体要怎么做?
猜你喜欢
随机推荐
接口性能测试方案设计方法有哪些?要怎么去写?
Redis高可用
Django实现对数据库数据增删改查(一)
Redis Basics
性能测试包括哪些方面?分类及测试方法有哪些?
canal工作原理及简单案例演示
Environment build onnxruntime 】
"The camera can't be used" + win8.1 + DELL + external camera + USB drive-free solution
Consolidation of Questionnaire Questions and Answers
初窥门径代码起手,Go lang1.18入门精炼教程,由白丁入鸿儒,首次运行golang程序EP01
使用图新地球无法加载谷歌地球的完美解决方法(附软件下载)
MySQL查漏补缺(四)存储过程和游标
lateral view explode的另一种实现方式
【培训课程专用】Secureboot
本体开发日记05-努力理解SWRL(Built-Ins)
问卷问题和答案的合并
These 12 GIS software are better than the other
不支持关键字: 'Provider'
【Pytorch】安装mish_cuda
本体开发日记01-Jena配置环境变量