title: Trying to use HashMap to associate letters to numbers
body: <p>I'm trying to use Hashmap to make a dictionary of 26 key-value pairs. I'm trying to link each letter of the alphabet to a number, and then iterate through a string and letter by letter print the letter values from the HashMap.</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>import java.util.*;
  
  public class HashDemo {
      public static void main(String[] args) {
      HashMap hm = new HashMap();
      hm.put("a", 2);
      hm.put("b", 3);
      hm.put("c", 5);
      hm.put("d", 7);
      hm.put("e", 11);
  
      String word = new String("bed");
      char arr[] = word.toCharArray();
      for(char c: word) {
          System.out.println(hm.get(c));
      }
    }
  }
  </code></pre>
  
  <p>My Output when compiled was:  </p>
  
  <pre><code>Note: HashMapDemo.java uses unchecked or unsafe op  
  Note: Recompile with -Xlint:unchecked for details.  
  1 error 
  </code></pre>
  
  <p>My Output when run anyway was:  </p>
  
  <pre><code> Null
  </code></pre>
  
  <p>I don't get why it can't find the letter in the hashmap. Is it because the hashmap keys are strings not chars? If it is i'm not sure what to do still.</p>