title: Create a Array from HashMap in Java
body: <p>I want to create a Array of String from a Hashmap In java?</p>
  
  <p>My <strong>HashMap</strong> is like this </p>
  
  <pre><code>HashMap&lt;String, String&gt; param = new HashMap&lt;String, String&gt;();
                   param.put("A", "2");
                   param.put("B", "3");
                   param.put("C", "2");
  </code></pre>
  
  <p>I want to create a <strong>Array</strong> of String like this .</p>
  
  <pre><code>String[] list = {"A 1", "A 2","B 1","B 2","B 3","C 1","C 2"};
  </code></pre>
  
  <p>Edit: </p>
  
  <blockquote>
    <p>relationship between input and out put. If key A's value is 2 out put
    should contains A 1 and A 2 like wise if key B's value is 3 out put should
    contains B 1 B 2 B3 and so on.</p>
  </blockquote>
  
  <p>What i have done is </p>
  
  <pre><code>public class test {
      public static void main(String[] args) {
          HashMap&lt;String, String&gt; param = new HashMap&lt;String, String&gt;();
          param.put("A", "2");
          param.put("B", "3");
          param.put("C", "2");
  
          String[] list = new String[param.size()];
          int i = 0;
          int a= Integer.parseInt(param.get("A"));
          for (int j = 1;j&lt;= a;j++) {
              list[i] = ("a" +j);
              System.out.println(list[i]);
              i++;
  
          }
  
      }
  </code></pre>
  
  <p>I am new In Java .Please help to how could i do this .Thanks</p>