collections - Java - Simple way to put LinkedHashMap keys/values into respective Lists? -


i have linkedhashmap < string, string > map .

list < string > keylist; list < string > valuelist;  map.keyset(); map.values(); 

is there easy way populate keylist map.keyset() , valuelist map.values(), or have iterate?

most collections accept collection constructor argument:

list<string> keylist = new arraylist<string>(map.keyset()); list<string> valuelist = new arraylist<string>(map.values()); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -