Aman Tandon wrote:In my case i will got the string array having values like suppose
so in this case there will be a nested hashmap of <String, String >
so the main key will be animal, land is child of animal, tiger and deer are the sibblings and have these corresponding values
i have to create the hashmap<String, String> dynamically whenever i got that array
Still, not completely sure ... but ... I think you are trying to say you want a tree of hashmaps, where the leaves are HashMap<String, String> instances and the branches are HashMap<String, HashMap<String, ?>> instances. IMO, your best option is to use HashMap<String, Object> instances, and your code is then responsible for checking whether the value is a leaf or a branch.
Aman Tandon wrote:yeah you is right sir
i am really confused to how to do this..
main key is params
first time if i got the string :->
then hashmap should be like this
if the next string comes up like :->
then params will becomes,
I will be really thankful to you....please help me out
Not exactly sure of the current issue yet. Your latest description is almost the same as you previous one, so I am still of the opinion that your previous design is still fine. Or are you asking about implementation? Meaning the issue is not really related to the design, but how to actually code it?