Dictionary Class Methods in Java

java.util.Dictionary<K, V>

The Dictionary class 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.


Some methods of Dictionary class.


get(Object)This method returns the value to which the key is mapped in this dictionary.


isEmpty()This method tests if this dictionary maps no keys to value.


elements()This method returns an enumeration of the values in this dictionary.


equals(Object)This method indicates whether some other object is "equal to" this one.


keys()This method returns an enumeration of the keys in this dictionary.


put(K, V)This method maps the specified key to the specified value in this dictionary.


remove(Object)This method removes the key (and its corresponding value) from this dictionary.


size()This method returns the number of entries (distinct keys) in this dictionary.


toString()This method returns a string representation of the object.


No comments:

Post a Comment