HashMap

作者: Sam丶yuH | 来源:发表于2019-03-21 23:11 被阅读0次

1.所有元素都能被允许成为key和value,包括null.

2.hashmap是无序的,如果你需要确定顺序的可以使用LinkedHashMap

3.因为hashmap是不同步的,所以它是线程不安全的,要想它安全则使用

Map map = Collections.synchronziedMap(new HashMap()).

4.HashMap 默认长度是16,扩展是原来的两倍。继承于AbstractMap

相关文章

网友评论

      本文标题:HashMap

      本文链接:https://www.haomeiwen.com/subject/bhfkvqtx.html