title: Which type of collections to use for storing a country list
body: <p>Hi I'm trying to store a country list where I've wrote down all countries in a text file. Im trying to put the list in a HashMap in java but no success so far.
  I want to sort the keys by first letter eg.(Key="A" gives Value(Algeria)) and i also want to have multiple values for each key to hold.
  Is there any other way to accomplish this?</p>
  
  <pre class="lang-java prettyprint-override"><code>//containers for the country names
  private Map&lt;String, List&lt;String&gt;&gt; letter_map;
  private List&lt;List&lt;String&gt;&gt; letter_list;
  private String[] letters = {"A", "B", "C", "D", "F", "E", "F", "G", "I", "J", "K", 
                              "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};//0-25
  
  
  
  public void country_handler(){
      String tempLetter;
      int i = 0;
      letter_list = new ArrayList&lt;List&lt;String&gt;&gt;(25);
      List&lt;String&gt; tempList = new ArrayList&lt;String&gt;();
      //file path
      File f = new File("/Users/rojandinc/Documents/workspace/First_letter_game/src/game_logic/countries");
  
      //read file into list
      try (BufferedReader br = new BufferedReader(new FileReader(f))) {//file reader
          String line;
          while ((line = br.readLine()) != null &amp;&amp; i &lt; 26) {//read in every line (country)
             if(line.startsWith(letters[i].toString())){
                 tempList.add(line);
             }
             else{
                 letter_list.add(tempList);
                 tempList.clear();
                 tempList = new ArrayList&lt;String&gt;();
                 tempList.add(line);
                 i++;
             }           
          }
  
          //add values to map
          for(int j = 0; j &lt; letter_list.size(); j++){
              letter_map.put(letters[j].toString(), letter_list.get(j));
          }
  
      }catch (IOException e) {
          System.out.println(e.toString());
      }
      System.out.println("Done with map");
  }
  </code></pre>