title: accessing a ConcurrentHashMap of Objects that can be ConcurrentHashMaps
body: <p>I'm trying to hold data in one dynamic container for productivity's sake.</p>
  
  <p>I initialize it inside a <code>class</code> with</p>
  
  <pre><code>private final ConcurrentHashMap&lt;String, Object&gt; allInOne = 
      new ConcurrentHashMap&lt;String, Object&gt;();
  </code></pre>
  
  <p><code>allInOne.put("total", 0.0);</code> works without error.</p>
  
  <p><code>allInOne.put(account, new ConcurrentHashMap&lt;String, Object&gt;());</code> works without error.</p>
  
  <p><code>allInOne.get(account).put("total", 0.0);</code> makes <code>javac</code> give:</p>
  
  <pre><code>DynamicConcurrentHashMapper.java:162: error: cannot find symbol
          allInOne.get(account).put("total", 0.0);
                                ^
  symbol:   method put(String,double)
  location: class Object
  </code></pre>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/2774608/accessing-nested-hashmaps-in-java">How do I access nested HashMaps in Java?</a>, and I'm happy to have a solution, but is there any way to do it without casting?  If not, is there a better way to template <code>allInOne</code>?</p>
  
  <hr>
  
  <p><strong>Special Case</strong></p>
  
  <p>I agree with all that this is bad practice for strict atomicity and recommend against it to others, but I'm trying to get a working prototype done as soon as possible.</p>