title: Difference between HashMaps put and add
body: <p>What is the difference between</p>
  
  <pre><code>ans.put(key, new ArrayList());
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ans.get(key).add(s);
  </code></pre>
  
  <p><code>ans</code> is the <code>HashMap</code> and <code>s</code> is a <code>String</code> object.</p>