Java Dictionary Class
Java.util package provides a Dictionary class which is the abstract parent of any class, such as Hashtable, which maps keys to values. Every key and every value is an object. In any one Dictionary object, every key is associated with at most one value. Given a Dictionary and a key, the associated element can be looked up. Any non-null object can be used as a key and as a value.
The declaration of java.util.Dictionary class is:
public abstract class Dictionary<K,V> extends Object
|S.N||Constructors & Description|
The java.util.Dictionary class has a number of methods which are listed below:
|S.N||Methods & Description|
abstract Enumeration<V> elements()|
Returns an enumeration of the values in this dictionary.
abstract V get(Object key)|
Returns the value to which the key is mapped in this dictionary.
abstract boolean isEmpty()|
Tests if this dictionary maps no keys to value.
abstract Enumeration<K> keys()|
Returns an enumeration of the keys in this dictionary.
abstract V put(K key, V value)|
Maps the specified key to the specified value in this dictionary.
abstract V remove(Object key)|
Removes the key (and its corresponding value) from this dictionary.
abstract int size()|
Returns the number of entries (distinct keys) in this dictionary.
This class inherits the methods of following class: