What is the best way to convert a Map<key,value> to a List<value>? Just iterate over all values and insert them in a list or am I overlooking something?

14 s
14

List<Value> list = new ArrayList<Value>(map.values());

assuming:

Map<Key,Value> map;

Leave a Reply

Your email address will not be published. Required fields are marked *