Using HashMap in Java to make a morse code : <p>so i am learning how to use the HashMap object. My question is, if I use the scanner object to ask a user for a String and I save that to a String variable. How can I take that String and "compare" it to my HashMap. </p>

<p>For example if a user inputs "abc". </p>

<p>My HashMap has ("a","abra") ("b","blastoise") ("c","charizard")</p>

<p>I want to print to System.out.println the result -- abra blastoise charizard instead of abc.</p>

<p>I will share my code that i have now but i am stuck with the next step and i hope that i am being clear with my question. </p>

<pre><code>    public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    String keyboard = "";
    HashMap hm = new HashMap();

    hm.put("A","Abra");
    hm.put("B", "Blastoise");
    hm.put("C", "Charizard");
    hm.put("D", "Dewgong");

    keyboard = sc.nextLine();
</code></pre>

<p>Thank you in advanced :)</p>
