{"id":93,"date":"2023-02-14T21:53:10","date_gmt":"2023-02-14T13:53:10","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=93"},"modified":"2023-02-14T21:53:53","modified_gmt":"2023-02-14T13:53:53","slug":"java-map-datastructure","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/14\/java-map-datastructure\/","title":{"rendered":"Java Map\u6570\u636e\u7ed3\u6784\u603b\u7ed3"},"content":{"rendered":"<h2>Hashtable \u548c HashMap \u7684\u533a\u522b<\/h2>\n<ul>\n<li><code>Hashtable<\/code>\u548c<code>HashMap<\/code>\u90fd\u5b9e\u73b0Map\u63a5\u53e3\uff0c\u4f46\u662f<code>Hashtable<\/code>\u7684\u5b9e\u73b0\u662f\u57fa\u4e8e<code>Dictionary<\/code>\u62bd\u8c61\u7c7b<\/li>\n<li>\u5728<code>HashMap<\/code>\u4e2d\uff0cnull\u53ef\u4ee5\u4f5c\u4e3akey\u6216value\uff1b\u800c\u5728<code>Hashtable<\/code>\u4e2d\uff0c\u65e0\u8bba\u662fkey\u8fd8\u662fvalue\u90fd\u4e0d\u80fd\u4e3anull<\/li>\n<li><code>Hashtable<\/code>\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c<code>HashMap<\/code>\u5219\u4e0d\u662f\u7ebf\u7a0b\u5b89\u5168\u7684<\/li>\n<\/ul>\n<h2>Map\u6570\u636e\u7ed3\u6784\u7ebf\u7a0b\u5b89\u5168\u603b\u7ed3<\/h2>\n<ul>\n<li><code>HashMap<\/code>\uff1a\u7ebf\u7a0b\u4e0d\u5b89\u5168<\/li>\n<li><code>Hashtable<\/code>\uff1a\u7ebf\u7a0b\u5b89\u5168\uff0c\u4e00\u6b21\u9501\u4f4f\u6574\u4e2ahash\u8868<\/li>\n<li><code>SynchronizedMap<\/code>\uff1a\u90e8\u5206\u7ebf\u7a0b\u5b89\u5168\uff0c\u65b9\u6cd5\u52a0\u9501\uff0c\u65b9\u6cd5\u7ec4\u5408\u4f7f\u7528\u9700\u624b\u52a8\u52a0\u9501<\/li>\n<li><code>ConcurrentHashMap<\/code>\uff1a\u7ebf\u7a0b\u5b89\u5168\uff0c\u5206\u6bb5\u9501\u3002<code>ConcurrentHashMap<\/code>\u4e00\u6b21\u9501\u4f4f\u4e00\u4e2aSegment(\u6876)\u3002<code>ConcurrentHashMap<\/code>\u9ed8\u8ba4\u5c06hash\u8868\u5206\u4e3a16\u4e2a\u6876\uff0c\u8bf8\u5982<code>get,put,remove<\/code>\u7b49\u5e38\u7528\u64cd\u4f5c\u53ea\u9501\u5f53\u524d\u9700\u8981\u7528\u5230\u7684\u6876<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hashtable \u548c HashMap \u7684\u533a\u522b Hashtable\u548cHashMap\u90fd\u5b9e\u73b0Map\u63a5\u53e3\uff0c\u4f46\u662fHas [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-data-structure-algorithm"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}