Map 的初始容量是多少(hashMap)

来源:互联网 发布:张逗张花家很富吗 知乎 编辑:程序博客网 时间:2024/05/08 11:39

  static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16



    /**
     * Constructs an empty <tt>HashMap</tt> with the default initial capacity
     * (16) and the default load factor (0.75).
     */
    public HashMap() {
        this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
    }


0 0
原创粉丝点击