I have this simple problem which I cannot solve.
I have this Map which stores the sessions:
Map<String, ActiveConnections>
I want to get all String values and insert them into ArrayList.
Can you tell em how I can do this?
I have this simple problem which I cannot solve.
I have this Map which stores the sessions:
Map<String, ActiveConnections>
I want to get all String values and insert them into ArrayList.
Can you tell em how I can do this?
Map contains a method called keySet()
, Which
Returns a Set view of the keys contained in this map.
Then use that Set
to build your List
, by using constructor or using addAll
method
keyList.addAll(set);