I have just studied Generics in Java via Oracle Docs TutorialTutorial. Now I have moved on to Collections Framework. I want to know that if Map interface is generic like this
public interface Map<K,V> {
// Basic operations
V put(K key, V value);
V get(Object key);
V remove(Object key);
boolean containsKey(Object key);
//some more method declarations
}
I want to know that why method signature of V get(Object key); V remove(Object key); boolean containsKey(Object key);
use Object as its argument and not K.