Home Java SCJP SCWCD Servlet Submit News Contact Us Site Map


Over 500 magazines for free (including Oracle Magazine)!

Yes all of them are FREE. You can subscribe to ALL of them.
Click here to apply today!

Home > Java > Java Articles

HashMap Basic methods

Object get (Object key)
Returns the value mapped to the specified key, or null if no entry is found.

Object put (Object key, Object value)
Maps the specified key to the specified value in this HashMap and returns the value previously associated with the specified key, if any. Otherwise, it returns the null value.

Object remove (Object key)
Removes the key and its associated value from the HashMap, and returns the value previously associated with the specified key, if any. Otherwise, it returns the null value.

boolean containsKey(Object key)
Returns true if the specified key is mapped to some value in the map, otherwise false.

boolean containsValue(Object value)
Returns true if there are one or more keys mapped to the specified value, otherwise false.

int size()
Returns the size of the HashMap.

boolean isEmpty()
returns true if HashMap is empty, otherwise false.

 

<< HashMap Constructor

HashMap Operations >>


Home Java SCJP SCWCD Servlet Site map