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
Post a Comment