Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

Hashtable Basic Methods

Hashtable 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 hashtable 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 hashtable, 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 hashtable.

boolean isEmpty()
Returns true if hashtable is empty, otherwise false.


<< Hashtable Constructor    Hashtable Other Methods >>
Your rating: None Average: 5 (1 vote)
Share this

Post new comment