title: Getting 'Type mismatch: cannot convert from ArrayList<HashMap<String,String>> to List<Map<String,String>>' while instantiating a list of maps
body: <pre><code>List&lt;Map&lt;String, String&gt;&gt; recordMapList = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();
  </code></pre>
  
  <p>The above line gives the error:
  Type mismatch: cannot convert from ArrayList> to List></p>
  
  <p>But the issue goes away if use HashMap instead of Map in the left hand side.
  Could someone tell me why this happens.
  I need to have the left hand side to contain Map as I might be using the same variable to assign LinkedHashMap in the righ side like,</p>
  
  <pre><code>List&lt;Map&lt;String, String&gt;&gt; recordMapList = new ArrayList&lt;LinkedHashMap &lt;String,String&gt;&gt;();
  </code></pre>
  
  <p>Please help.</p>