Good day, this is kind of confusing me now(brain freeze!) and seem to be missing something. Have an ArrayList which i populate with a HashMap. now i put in my HashMap and arrayl
List constructor accepts any data structure that implements Collection interface to be used to build a list.
To get all the keys from a hash map to a list:
Map map = new HashMap();
List keys = new ArrayList<>(map.keySet());
To get all the values from a hash map to a list:
Map map = new HashMap();
List values = new ArrayList<>(map.values());