HapMap(); HapMap(Map m); HapMap(int capacity); /** * Constructs an empty <tt>HashMap</tt> with the specified initial * capacity and load factor. * @param initialCapacity the initial capacity 初始化的容量 * @param loadFactor the load factor 扩展因子 TODO待理解 * @throws IllegalArgumentException if the initial capacity is negative * or the load factor is nonpositive */ HapMap(int capacity,float loadFactor);
关键函数
1 2 3 4 5 6
publicbooleanisEmpty(); public V get(Object key); public V put(K key, V value) public V remove(Object key) public Set<K> keySet() publicabstract Set<Entry<K,V>> entrySet();