iterating through a collection of collections?

I have created a TreeMap of TreeMaps. I can iterate through the main map just fine, but I can't figure out how to iterate through the sub map. (the goal is to iterate through each sub map while iterating through the main map, not just to iterate through a particular sub map, if that makes any difference)

Any suggestions? Is it even possible?


  • yes, its possible. you must nest two iterators, the first returns the treemaps one by one and the other iterates through the returned treemap.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion