how to use put method in map type in JAVA? <p>I have a <code>Map</code> type variable </p> <pre><code>a = new HashMap&lt;String, ArrayList&lt;String&gt;&gt;(); </code></pre> <p>My question are:</p> <ol> <li><p>For example, now I have <code>String b, String c</code>, how to use <code>put()</code> method to put it into the map? I don't know how to write the expression.</p></li> <li><p>If I want to just put in a key, for example <code>String d</code>, and do not add any string to the value set, how to write it?</p></li> </ol> <p>Thank you!</p>