title: Printing HashMap of HashMaps : Map.Entry or java8
body: <p>I have a method which returns out hashmap of hashmaps</p>
  
  <pre><code>HashMap&lt;String, HashMap&lt;String, String&gt;&gt; mapofmaps = abcd(&lt;String&gt;, &lt;Integer&gt;);
  </code></pre>
  
  <p>I am trying to print the the outer hashmap using the following code</p>
  
  <pre><code>for (Entry&lt;String, HashMap&lt;String, String&gt;&gt; entry : mapofmaps.entrySet()) {
              String key = entry.getKey();
              System.out.println(key);
  
        HashMap&lt;String, String&gt; value = entry.getValue();
              System.out.println(key + "\t" + value);
          }
  </code></pre>
  
  <p>I would like to iterate through the inner map. What would be the entryset variable there (??? in the code). </p>
  
  <pre><code>for (Entry&lt;String, HashMap&lt;String, String&gt;&gt; entry : mapofmaps.entrySet()) {
                  String key = entry.getKey();
                  System.out.println(key);
      for(Entry&lt;String, HashMap&lt;String, String&gt;&gt; entry : ????.entrySet()){
            HashMap&lt;String, String&gt; value = entry.getValue();
                  System.out.println(key + "\t" + value);
              }}
  </code></pre>
  
  <p>Is my logic for printing the hashmaps correct? or is there a better way to do that?</p>