hashtable,concurrenthashmap为什么键和值不能为null,而hashmap可以? |
您所在的位置:网站首页 › hashtable允许键值为空吗 › hashtable,concurrenthashmap为什么键和值不能为null,而hashmap可以? |
doc转换markdown
DEADcat_12: https://word-to-markdown.herokuapp.com/没了(大哭) hashtable,concurrenthashmap为什么键和值不能为null,而hashmap可以?nacrt: 从ConcurrentHashMap他自己的作者(Doug Lea): http://cs.oswego.edu/pipermail/concurrency-interest/2006-May/002485.html The main reason that nulls aren't allowed in ConcurrentMaps (ConcurrentHashMaps, ConcurrentSkipListMaps) is that ambiguities that may be just barely tolerable in non-concurrent maps can't be accommodated. The main one is that if map.get(key) returns null, you can't detect whether the key explicitly maps to null vs the key isn't mapped. In a non-concurrent map, you can check this via map.contains(key), but in a concurrent one, the map might have changed between calls. ConcurrentMaps(ConcurrentHashMaps,ConcurrentSkipListMaps)不允许使用null的主要原因是,无法容纳在非并行映射中几乎无法容忍的歧义。最主要的是,如果map.get(key)return null,则无法检测到该键是否显式映射到null该键。在非并行映射中,您可以通过进行检查 map.contains(key),但在并行映射中,两次调用之间的映射可能已更改 django自带的server 让外网主机访问zhang__8626 回复 一只快乐的野指针吼: 如果在本地运行只能局域网访问,如果放在服务器上运行,浏览器输入服务器公网IP所有人都可见 爬取微博用户的原创微博weixin_38525647: 您好,我在最后一步的代码出了问题,显示: 存放数据地址有误 该用户原创微博中不存在图片 Traceback (most recent call last): File "E:/weibo Project/weibo.py", line 128, in print(u'原创微博爬取完毕,共%d条,保存路径%s'%(word_count - 3,word_path)) NameError: name 'word_path' is not defined 请问是怎么回事? django自带的server 让外网主机访问一只快乐的野指针吼: 这个是当前局域网可以访问,还是所有人都能访问? |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |