title: What is the main benefit of using HashMap in java?
body: <p>In this Java project I'm looking at, I keep seeing code with HashMap, like so</p>
  
  <pre><code> /** imageID --&gt; image map */
      Map&lt;String,ImageIcon&gt; imgs = new HashMap&lt;String,ImageIcon&gt;();
  </code></pre>
  
  <p>Then later in the class:</p>
  
  <pre><code>// images 
  loadImages();
  actualImage = imgs.get(this.DEFAULT_IMAGE_ID);
  JLabel label = new JLabel(actualImage);
  </code></pre>
  
  <p>What is the purpose of this code? I am foggy on the whole concept here.</p>