当前位置:网站首页>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());
边栏推荐
- Venture DAO Industry Research Report: Macro and Classic Case Analysis, Model Summary, Future Suggestions
- 一个项目的整体测试流程有哪几个阶段?测试方法有哪些?
- 营养与健康(HIT2021秋)
- Swap swap partition
- web测试之功能测试常用的方法有哪几种?有什么要点要注意?
- 进入大厂的面试经验(P7)
- [Environmental Construction] tensorrt
- 单元测试是什么?怎么写?主要测试什么?
- MySQL索引
- 初窥门径代码起手,Go lang1.18入门精炼教程,由白丁入鸿儒,首次运行golang程序EP01
猜你喜欢
Redis high availability
栈的实现之用链表实现
lateral view explode的另一种实现方式
常用功能测试的检查点与用例设计思路
“摄像头用不了”+win8.1+DELL+外置摄像头+USB免驱的解决办法
运行flutter项目时遇到的问题
Summary of steps and methods for installing and uninstalling test cases that you must read
MySQL Checking and Filling Leaks (5) Unfamiliar Knowledge Points
MySQL事件_单次事件_定时循环事件
本体开发日记03-理解代码
随机推荐
jfinal加载配置文件原理
不支持关键字: 'Provider'
高清卫星地图浏览器
Domestic Google earth, terrain analysis seconds kill with the map software
手机APP测试流程规范和方法你知道多少?
Anaconda4.8.3介绍、安装及使用教程安装(win10)并修改Jupyter默认工作目录
MySQL transaction isolation
奥维地图电脑端手机端不能用了,有没有可替代的地图工具
JMeter初探五-配置元件与参数化
Redis高可用
SQL server中的数据类型
web测试之功能测试常用的方法有哪几种?有什么要点要注意?
lateral view explode的另一种实现方式
代码导读-目录
Difference: char* and char[]
Global 19 Google Satellite Map Free View Download
困扰很久的问题。今天下午搞定了。
全球19级谷歌卫星地图免费查看下载
TestNG使用教程详解
These 12 GIS software are better than the other