标签:ecif spec ret 常用 构造 extend object this cap
Class HashMap<K,V>
1.包:java.util;
2.K-键,V-值
3.构造方法:
HashMap();
HashMap(int initialCapacity)
HashMap(int initialCapacity,float loadFactor)
HashMap(Map<?extends K,?extends V>m)
4.常用方法:
(1)clear()
Removes all of the mappings from this map
(2)containsKey(Object key)
Returns true if this map contains a mapping for the specified key.
(3)containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.
(4)get(Object key)
Returns the value to which the specified key is mapped, or null
if this map contains no mapping for the key.
(5)isEmpty()
Returns true if this map contains no key-value mappings.
(6)put(K key,V value)
Associates the specified value with the specified key in this map.
(7)size()
Returns the number of key-value mappings in this map.
标签:ecif spec ret 常用 构造 extend object this cap
原文地址:https://www.cnblogs.com/bitreea/p/12306314.html