title: Java Map<K,V> : Why get(object) not get(K)?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1455138/java-generics-why-does-map-get-ignore-type">Java Generics: Why Does Map.get() Ignore Type? </a>  </p>
  </blockquote>
  
  
  
  <p>Could someone please explain why with Map defines</p>
  
  <pre><code>V put(K key,V value);
  V get(Object key);
  </code></pre>
  
  <p>Why is <code>get</code> not defined as:</p>
  
  <pre><code>V get(K key)
  </code></pre>
  
  <p>Similarly, why are these methods typed to <code>Object</code>, and not <code>K</code> and <code>V</code> respectively?</p>
  
  <pre><code>boolean containsKey(Object key); // Why not K?
  boolean containsValue(Object value); // Why not V?
  </code></pre>
  
  <p>Is this a backwards compatibility thing (pre 1.5)?</p>