我如何在java中拥有唯一键的HashMap? [英] How can I have a HashMap with unique keys in java?

查看:119
本文介绍了我如何在java中拥有唯一键的HashMap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Java中拥有唯一键的HashMap?
或者甚至在HashMap中使用唯一键还是有意义的,或者这些键在默认情况下是唯一的?
我是新手。
thx

How can I have a HashMap with unique keys in Java? Or even does this make any sense to have unique keys in HashMap or the keys are unique by default? I am a newbie. thx

推荐答案

这些键在所有地图中都是唯一的。各种地图实现之间的区别涉及空键的可能性,迭代顺序和并发问题。

The keys are unique in all maps. The difference between the various maps implementations concern the possibility of null keys, the order of iteration and concurrency issues.

这篇关于我如何在java中拥有唯一键的HashMap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆