title: How to retrieve data from nested disctionary in java
body: <p>I have two dictionaries added into parent dictionary. How to retrieve data from a value (which is a dictionary)</p>
  <pre><code>import java.util.*;
  
  class HelloWorld {
    public static void main(String[] args) {
      int count =2;
      
      Dictionary parent_dic = new Hashtable();
      Dictionary child1 = new Hashtable();
      Dictionary child2 = new Hashtable();
      Dictionary child = new Hashtable();
      
      child1.put(&quot;1&quot;, &quot;one&quot;);
      child1.put(&quot;2&quot;, &quot;two&quot;);
      System.out.println(&quot;Child1&quot; + child1);
      
      child2.put(&quot;3&quot;, &quot;three&quot;);
      child2.put(&quot;4&quot;, &quot;four&quot;);
      System.out.println(&quot;Child2&quot; + child2);
      
     for(int each_c = 1; each_c &lt;= count; each_c++) {
         if(each_c==1) {
             child = child1;
         } else {
             child = child2;
         }
         parent_dic.put(each_c,child);
     }
     
      
      System.out.println(&quot;Parent&quot; + parent_dic);
      System.out.println(&quot;test ::: &quot; + parent_dic.get(1));
      
  }
  </code></pre>
  <p>}</p>
  <p>How to get value from resultant value (which is dictionary)?</p>
  <p>Output:</p>
  <pre><code>Child1{2=two, 1=one}
  Child2{4=four, 3=three}
  Parent{2={4=four, 3=three}, 1={2=two, 1=one}}
  test ::: {2=two, 1=one}
  </code></pre>
  <p>How to get value &quot;two&quot; from above test dictionary.</p>