title: Why Map.containsKey() takes an Object parameter instead of a speciallized type?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/857420/what-are-the-reasons-why-map-getobject-key-is-not-fully-generic">What are the reasons why Map.get(Object key) is not (fully) generic</a><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>Java <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Map.html#containsKey%28java.lang.Object%29" rel="nofollow noreferrer">Map</a> interface is declared like this:</p>
  
  <pre><code>Interface Map&lt;K,V&gt;
  </code></pre>
  
  <p>It has such a method:</p>
  
  <pre><code>boolean containsKey(Object key)
  </code></pre>
  
  <p>Why not 
   <code>boolean containsKey(K key)</code>?</p>
  
  <p>On the contrary, the <a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html#add%28E%29" rel="nofollow noreferrer">List</a> interface has add method that takes parameter of generic type instead of <code>Object</code>:</p>
  
  <pre><code>boolean add(E e).
  </code></pre>