Back
What is the best way to change a Map<key, value> to a List<value>? Just iterate over every value and insert them in a list or am I overlooking something?
The problem here is that Map has two values (a key and value), while a List only has one value (an element).
Hence, the best that can be done is to either get a List of the keys or the values:
List<Value> list = new ArrayList<Value>(map.values());
30.9k questions
32.9k answers
500 comments
665 users