title: Why does HashMap implement Map if it extends AbstractMap?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2294519/java-util-hashmap-why-hashmap-extends-abstractmap-and-implement-map">Java.util.HashMap &mdash; why HashMap extends AbstractMap and implement Map?</a>  </p>
  </blockquote>
  
  
  
  <p>In java to implement <code>HashMap&lt;K,V&gt;</code> we need to implement <code>Map&lt;K,V&gt;</code>.</p>
  
  <p>However when I debugged more in java classes it seems that.... java defines <code>HashMap</code> class as following.</p>
  
  <p><code>public class HashMap&lt;K,V&gt;
      extends AbstractMap&lt;K,V&gt;
      implements Map&lt;K,V&gt;, Cloneable, Serializable</code></p>
  
  <p>At the same time i saw <code>public abstract class AbstractMap&lt;K,V&gt;</code> implements <code>Map&lt;K,V&gt;</code> it also implements the interface <code>Map&lt;K,V&gt;</code>.</p>
  
  <p>If abstract class implements the interface then, what is the reason behind implementing <code>Map&lt;K,V&gt;</code> at <code>HashMap</code> class level?</p>
  
  <p>As per my understanding <code>HashMap</code> class have all the methods inherited from <code>AbstractMap</code> which can be overridden by <code>HashMap</code> as per the requirement. </p>