![hasmap of all words in dictionary java hasmap of all words in dictionary java](https://media.geeksforgeeks.org/wp-content/uploads/20201130160242/Screenshot220.png)
The put() method inserts the elements in the dictionary. Java Dictionary Programs Use of Dictionary.put() Method It returns the number of entries (distinct keys) in this dictionary. It throws NullPointerException if the key is null. Note that the method does nothing if the key is not in the dictionary. The method parses a key that we want to remove. It throws NullPointerException if the key or value is null. If the dictionary does not already have an entry for the specified key, an entry is created for the specified key and value, and null is returned. Java HashMap In the ArrayList chapter, you learned that Arrays store items as an ordered collection, and you have to access them with an index number ( int type). If the dictionary already contains an entry for the specified key, the value already in this dictionary for that key is returned, after modifying the entry to contain the new element. Note that neither key nor value can be null. It maps the specified key to the specified value in this dictionary. The method is used to insert key-value pair in the dictionary. The returned enum object generates all the keys for which this dictionary contains entries. It returns an enum of the keys in this dictionary. It returns true if and only if this dictionary contains no entries, else returns false. How does Hashtable work internally in Java Hashtable internally contains buckets in which it stores the key/value pairs. The method checks if this dictionary maps no keys to value. For example, if we have a list of 10,000 words of English and we want to check if a given word is in the list, it would be inefficient to successively compare the word with all 10,000 items until we find a match. Note that if this dictionary contains an entry for the specified key, the associated value is returned otherwise, null is returned. It parses an object (key) in this dictionary. It returns the value to which the key is mapped in this dictionary. The returned enum object generates all the elements contained in entries in this dictionary. It returns an enumeration of the values in this dictionary. The following table describes the methods.
![hasmap of all words in dictionary java hasmap of all words in dictionary java](https://sp-uploads.s3.amazonaws.com/uploads/services/971125/20210701032608_60dd35d00635e_104page1.png)
All the methods of the Dictionary class are abstract.