Java programming question

Soldato
Joined
17 Dec 2006
Posts
8,197
Is it possible to convert a HashMap, where the value is a HashSet, to an Array? Such as:

HashMap<String, HashSet<String>>

into an Array. An example would be if the key (String) was "name" and the HashSet had two String values of "joe" and "bloggs", and getting it into a String array as {"name", "joe", "bloggs"}.

Thanks :)
 
That's awesome, thanks a lot guys - interesting to see how you both wrote it slightly differently, and the differences between 8 and 11.
 
Back
Top Bottom