LinkedHashMap keys to ArrayList
14,367
List array = new ArrayList(map.keySet());
Author by
stefana
Updated on June 23, 2022Comments
-
stefana about 2 years
What is the easiest way to add the keys of a LinkedHashMap to an ArrayList? I would like to increase performance by removing loops. Is there a more efficient way?
for(String key : map.keySet()){ array.add(key); }