title: How to put an array object in hashmap?
body: <p>I'm trying to solve this but I'm stuck here for a while now. My problem is I can't find a way on how to put an array object to my hashmap. </p>
  
  <p>Here's my example code of hashmap for dropdown menu that I got from google.</p>
  
  <pre><code>private Map&lt;String,Map&lt;String,String&gt;&gt; data2 = new HashMap&lt;String,Map&lt;String,String&gt;&gt;();
  private String country; 
  private String city;  
  private Map&lt;String, String&gt; countries;
  private Map&lt;String,String&gt; cities;
  
   countries  = new HashMap&lt;String, String&gt;();
          countries.put("USA", "USA");
          countries.put("Germany", "Germany");
          countries.put("Brazil", "Brazil");
  
          Map&lt;String,String&gt; map = new HashMap&lt;String, String&gt;();
          map.put("New York", "New York");
          map.put("San Francisco", "San Francisco");
          map.put("Denver", "Denver");
          data2.put("USA", map);
  
          map = new HashMap&lt;String, String&gt;();
          map.put("Berlin", "Berlin");
          map.put("Munich", "Munich");
          map.put("Frankfurt", "Frankfurt");
          data2.put("Germany", map);
  </code></pre>
  
  <p>Now.. My problem is how to put my objects into hashmap. </p>
  
  <p>Here's my code in fetching the array object.</p>
  
  <pre><code>     while(rs.next()){
                       PropertyData reader = new PropertyData();
                       id = rs.getInt("id");
                       prop_name = rs.getString("prop_name");
                       prop_value = rs.getString("prop_value");
                       engine_name = rs.getString("engine_name");
                       //other setter..
  
  
                       reader.setId(id);
                       reader.setPropName(prop_name);
                       reader.setPropValue(prop_value);
                       reader.setEngineName(engine_name);
                       //other setter..
  
                       prop.add(reader);
                   }
  </code></pre>
  
  <p>From the code above. I want to put the <strong>id</strong> on hashmap key and <strong>propname</strong> on hashmap string name. Once selected, I want to display other values referencing the <strong>id</strong>. </p>
  
  <p>And this is where my object has been added. </p>
  
  <pre><code>    static List&lt;PropertyData&gt; prop = new ArrayList&lt;PropertyData&gt;();
  </code></pre>
  
  <p>I tried to initialized it on my hashmap but it returned null.</p>