Say we have a Map:
Mapm = new HashMap (); m.put("Hello", "World"); m.put("Apple", "3.14"); m.put("Another", "Element");
The keys as a List can be obtained by creating a new from a returned by the method:
Listlist = new ArrayList (m.keySet());
While the values as a List can be obtained creating a new ArrayList from a returned by the method:
Listlist = new ArrayList (m.values());
The result of getting the List of keys:
AppleAnotherHello
The result of getting the List of values:
3.14ElementWorld