Jyothi Thummalapenta wrote:I have a tree. How can i get the values of the TreeMap where the values are objects of a class..
I'm sorry, but that doesn't make much sense. Do you mean how do you get the objects held in a TreeMap (as opposed to the keys)?
If so, there are a few ways, but the simplest is to use the values() method, which will return you all the values in the Map, in key order, as a Collection.
I also strongly suggest that you type your Map as well. The keys are plainly Strings, and the values are Map1s (a very bad name, i might add), so tell Java that, viz:
Map<String, Map1> mp = new TreeMap<String, Map1>();
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here