title: Creating Global Map Java
body: <p>I would like to have a global <code>HashMap &lt;String, String&gt;</code> available to my whole project.</p>
  
  <p>The hashmap will remain the same throughout the whole project, so it only needs to be instatiated once. My idea was to have it in a <code>Utils</code> class and have a static public class like so:</p>
  
  <pre><code>public static String  getValue(String key){
      return map.get(key);
  }
  </code></pre>
  
  <p>The problem is, I don't want to have to run code to fill the hashmap with the Strings everytime I call <code>getValue</code>. So, where do I instantiate the code?</p>
  
  <p>If I could fill the hashmap similar to:</p>
  
  <pre><code>HashMap hm = {{Key, Value}, {Key, Value}......} 
  </code></pre>
  
  <p>It could then be global to the utils class and would possibly work.  </p>