Accessing nested HashMaps in Java

Posted by mridang on Stack Overflow See other posts from Stack Overflow or by mridang
Published on 2010-05-05T15:32:12Z Indexed on 2010/05/05 15:38 UTC
Read the original article Hit count: 477

Filed under:
|

Hi,

I have a HashMap in Java, the contents of which (as you all probably know) can be accessed by

HashMap.get("keyname");

If a have a HashMap inside another HashMap i.e. a nested HashMap, how would i access the contents? Can i do this like this, inline:

HashMap.get("keyname").get("nestedkeyname");

Thank you.

© Stack Overflow or respective owner

Related posts about java

Related posts about hashmap