Question: What are the Methods of Java TreeMap class?

Answer: Method:   Map.Entry<K,V> ceilingEntry(K key)
Description: It returns the key-value pair having the least key, greater than or equal to the specified key, or null if there is no such key.

Method:   K ceilingKey(K key)
Description: It returns the least key, greater than the specified key or null if there is no such key.

Method:   void clear()
Description: It removes all the key-value pairs from a map.

Method:   Object clone()
Description: It returns a shallow copy of TreeMap instance.

Method:   Comparator<? super K> comparator()
Description: It returns the comparator that arranges the key in order, or null if the map uses the natural ordering.

Method:   NavigableSet<K> descendingKeySet()
Description: It returns a reverse order NavigableSet view of the keys contained in the map.

Method:   NavigableMap<K,V> descendingMap()
Description: It returns the specified key-value pairs in descending order.

Method:   Map.Entry firstEntry()
Description: It returns the key-value pair having the least key.

Method:Map.Entry<K,V> floorEntry(K key)   
Description: It returns the greatest key, less than or equal to the specified key, or null if there is no such key.

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:   SortedMap<K,V> headMap(K toKey)
Description: It returns the key-value pairs whose keys are strictly less than toKey.

Method:NavigableMap<K,V> headMap(K toKey, boolean inclusive)   
Description: It returns the key-value pairs whose keys are less than (or equal to if inclusive is true) toKey.

Method:   Map.Entry<K,V> higherEntry(K key)
Description: It returns the least key strictly greater than the given key, or null if there is no such key.

Method:   K higherKey(K key)
Description: It is used to return true if this map contains a mapping for the specified key

Method:   Set keySet()
Description: It returns the collection of keys exist in the map.

Method:   Map.Entry<K,V> lastEntry()
Description: It returns the key-value pair having the greatest key, or null if there is no such key.

Method: Map.Entry<K,V> lowerEntry(K key)  
Description: It returns a key-value mapping associated with the greatest key strictly less than the given key, or null if there is no such key.

Method:   K lowerKey(K key)
Description: It returns the greatest key strictly less than the given key, or null if there is no such key.

Method:  NavigableSet<K> navigableKeySet() 
Description: It returns a NavigableSet view of the keys contained in this map.

Method:   Map.Entry<K,V> pollFirstEntry()
Description: It removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty.

Method: Map.Entry<K,V> pollLastEntry()  
Description: It removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.

Method:   V put(K key, V value)
Description: It inserts the specified value with the specified key in the map.

Method:   void putAll(Map<? extends K,? extends V> map)
Description: It is used to copy all the key-value pair from one map to another map.

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:   NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
Description: It returns key-value pairs whose keys range from fromKey to toKey.

Method:   SortedMap<K,V> subMap(K fromKey, K toKey)
Description: It returns key-value pairs whose keys range from fromKey, inclusive, to toKey, exclusive.

Method:   SortedMap<K,V> tailMap(K fromKey)
Description: It returns key-value pairs whose keys are greater than or equal to fromKey.

Method:   NavigableMap<K,V> tailMap(K fromKey, boolean inclusive)
Description: It returns key-value pairs whose keys are greater than (or equal to, if inclusive is true) fromKey.

Method:   boolean containsKey(Object key)
Description: It returns true if the map contains a mapping for the specified key.

Method:   boolean containsValue(Object value)
Description:It returns true if the map maps one or more keys to the specified value. 

Method:   K firstKey()
Description: It is used to return the first (lowest) key currently in this sorted map.

Method:  V get(Object key) 
Description: It is used to return the value to which the map maps the specified key.

Method: K lastKey()  
Description: It is used to return the last (highest) key currently in the sorted map.

Method: V remove(Object key)  
Description: It removes the key-value pair of the specified key from the map.

Method:   Set<Map.Entry<K,V>> entrySet()
Description: It returns a set view of the mappings contained in the map.

Method:   int size()
Description: It returns the number of key-value pairs exists in the hashtable.

Method:   Collection values()
Description: It returns a collection view of the values contained in the map.