Question: What are the Methods of Java Hashtable class?

Answer: Method:   void clear()
Description: It is used to reset the hash table.

Method:   Object clone()
Description: It returns a shallow copy of the Hashtable.

Method:   V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Description: It is used to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).

Method:   V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
Description: It is used to compute its value using the given mapping function, if the specified key is not already associated with a value (or is mapped to null), and enters it into this map unless null.

Method:   V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Description: It is used to compute a new mapping given the key and its current mapped value if the value for the specified key is present and non-null.

Method:  Enumeration elements() 
Description: It returns an enumeration of the values in the hash table.

Method:   Set<Map.Entry<K,V>> entrySet()
Description: It returns a set view of the mappings contained in the map.

Method:   boolean equals(Object o)
Description: It is used to compare the specified Object with the Map.

Method:   void forEach(BiConsumer<? super K,? super V> action)
Description: It performs the given action for each entry in the map until all entries have been processed or the action throws an exception.

Method:   V getOrDefault(Object key, V defaultValue)
Description: It returns the value to which the specified key is mapped, or defaultValue if the map contains no mapping for the key.

Method:   int hashCode()
Description: It returns the hash code value for the Map

Method:   Enumeration<K> keys()
Description: It returns an enumeration of the keys in the hashtable.

Method:   Set<K> keySet()
Description: It returns a Set view of the keys contained in the map.

Method:   V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
Description: If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value.

Method:   V put(K key, V value)
Description: It inserts the specified value with the specified key in the hash table.

Method:   void putAll(Map<? extends K,? extends V> t))
Description: It is used to copy all the key-value pair from map to hashtable.

Method:   V putIfAbsent(K key, V value)
Description: If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.

Method:   boolean remove(Object key, Object value)
Description: It removes the specified values with the associated specified keys from the hashtable.

Method:   V replace(K key, V value)
Description: It replaces the specified value for a specified key.

Method:   boolean replace(K key, V oldValue, V newValue)
Description: It replaces the old value with the new value for a specified key.

Method:   void replaceAll(BiFunction<? super K,? super V,? extends V> function)
Description: It replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.

Method:   String toString()
Description: It returns a string representation of the Hashtable object.

Method:   Collection values()
Description: It returns a collection view of the values contained in the map.

Method:   boolean contains(Object value)
Description: This method returns true if some value equal to the value exists within the hash table, else return false.

Method:   boolean containsValue(Object value)
Description: This method returns true if some value equal to the value exists within the hash table, else return false.

Method:   boolean containsKey(Object key)
Description: This method return true if some key equal to the key exists within the hash table, else return false.

Method:   boolean isEmpty()
Description: This method returns true if the hash table is empty; returns false if it contains at least one key.

Method:   protected void rehash()
Description: It is used to increase the size of the hash table and rehashes all of its keys.

Method:   V get(Object key)
Description: This method returns the object that contains the value associated with the key.

Method:   V remove(Object key)
Description: It is used to remove the key and its value. This method returns the value associated with the key.

Method:   int size()
Description: This method returns the number of entries in the hash table.