What is the function of the put(K key, V value), putAll(Map<K,V>, m) and putIfAbsent(K key, V value) methods of the Map interface?
Answer: The put() method will add the Key-Value pair to the map. returns the previous value stored with the same key. putAll() will copy all the provided pairs from the included map. The putIfAbsent method will add the Key-Value pair only if it is not already part of the map. Returns the value mapped to the provided key - new or existing.
If the answers is incorrect or not given, you can answer the above question in the comment box. If the answers is incorrect or not given, you can answer the above question in the comment box.