You need to iterate over your list, here is an example

public static void main(String[] args){
    List<LinkedHashMap<String,String>> list = new ArrayList<LinkedHashMap<String, String>>();

    LinkedHashMap<String, String> test = new LinkedHashMap<String, String>();
        test.put("a","1");
        test.put("b","2");

    list.add(test);

    for(Map<String, String> map : list){
        for(String key : map.keySet()){
            System.out.println("key: " + key + " value " + map.get(key));
        }
    }

}
Answer from Patrick M on Stack Overflow
🌐
Coderanch
coderanch.com › t › 568613 › java › Adding-key-pairs-HashMap-ArrayList
Adding key/value pairs from a HashMap in to an ArrayList (Beginning Java forum at Coderanch)
February 26, 2012 - For the desired output we can assume that the productAttribute parameter value is "Computer". Current output of the addProduct ArrayList: Desired output of the addProduct ArrayList: I can't seem to figure out what I'm doing wrong. Any help would be greatly appreciated. ... So you have a map which maps a String to a list of Strings. And if I understand your example right, you want to mutate that into a list of lists of Strings, where each of the inner lists comprises a key of the map followed by the list it's mapped to?
🌐
Quora
quora.com › How-do-I-add-a-key-value-pair-in-ArrayList-in-Java
How to add a key value pair in ArrayList in Java - Quora
Answer (1 of 4): We can’t directly store key value pair. But we can achieve it through creating an ArrayList of user defined class, having two instance variables say key, value. Please refer the below example for understanding better - Otherwise, Hashmap, LinkedHashMap, TreeMap are the the data...
🌐
Blogger
javahungry.blogspot.com › 2020 › 06 › hashmap-to-arraylist.html
Convert HashMap to ArrayList in Java | Java Hungry
Conversion of Key-Value Pairs into ArrayList For this, we are going to use the entrySet() method of HashMap class. This method returns the set of entries containing key-value pairs i.e. Entry ... import java.util.*; import java.util.Map.Entry; public class JavaHungry { public static void ...
🌐
Educative
educative.io › answers › how-to-convert-a-hashmap-to-an-arraylist
How to convert a HashMap to an ArrayList
HashMap is a collection class, based on Maps, that stores key and value pairs; they are denoted as HashMap<Key, Value> or HashMap<K, V>. ArrayList provides the dynamic arrays in Java.
🌐
GeeksforGeeks
geeksforgeeks.org › java › difference-between-arraylist-and-hashmap-in-java
Difference Between ArrayList and HashMap in Java - GeeksforGeeks
July 11, 2025 - ArrayList maintains the insertion order while HashMap does not maintain the insertion order which means ArrayList returns the list items in the same order while HashMap doesn’t maintain any order so returned key-values pairs any kind of order.
Find elsewhere
🌐
Spider's web
oprsteny.com
Java – How to store Array of pairs | Spider's web
public class Pair<Key,Value> { ... of type i.e. List<> using the following command · List<Pair<Integer,String>> pairList = new ArrayList<Pair<Integer,String>>();...
🌐
Guava
guava.dev › releases › 23.3-android › api › docs › com › google › common › collect › ArrayListMultimap.html
ArrayListMultimap (Guava: Google Core Libraries for Java 23.3-android API)
A HashMap associates each key with an ArrayList of values. When iterating through the collections supplied by this class, the ordering of values for a given key agrees with the order in which the values were added. This multimap allows duplicate key-value pairs.
🌐
LinkedIn
linkedin.com › pulse › mastering-java-collections-arraylist-hashmap-more-1c
Mastering Java Collections: ArrayList, HashMap, and More
August 8, 2023 - java import java.util.ArrayList; ... through the list for (String name : names) { System.out.println(name); } A HashMap is used to store key-value pairs....
🌐
Guava
guava.dev › releases › 23.6-android › api › docs › com › google › common › collect › ArrayListMultimap.html
ArrayListMultimap (Guava: Google Core Libraries for Java 23.6-android API)
A HashMap associates each key with an ArrayList of values. When iterating through the collections supplied by this class, the ordering of values for a given key agrees with the order in which the values were added. This multimap allows duplicate key-value pairs.
🌐
Baeldung
baeldung.com › home › java › java collections › java map › get values and keys as arraylist from a hashmap
Get Values and Keys as ArrayList From a HashMap | Baeldung
March 7, 2025 - List<String> keyList = new ArrayList<>(); List<String> valueList = new ArrayList<>(); for (Map.Entry<String, String> entry : DEV_MAP.entrySet()) { keyList.add(entry.getKey()); valueList.add(entry.getValue()); } assertKeyAndValueList(keyList, valueList); The test passes if we give it a run. So this approach does the job. If we work with Java 8 or later, we can replace the for loop with the forEach() call and a lambda expression to improve the code’s readability:
🌐
CodingTechRoom
codingtechroom.com › tutorial › java-understanding-java-collection-framework-key-value-pairs-with-arraylists-and-hashmaps
Understanding Java Value Keys, ArrayLists, and HashMaps: A Comprehensive Guide - CodingTechRoom
Basic understanding of Java syntax and programming concepts ... An ArrayList in Java is a resizable array implementation of the List interface. It allows you to store elements and access them via indices.
🌐
GeeksforGeeks
geeksforgeeks.org › java › how-to-convert-hashmap-to-arraylist-in-java
How to Convert HashMap to ArrayList in Java? - GeeksforGeeks
July 15, 2025 - Example: This example demonstrates how to convert the key-value pairs of a HashMap into an ArrayList of Map.Entry Objects. ... // Java Program to demonstrates // the working of entrySet() import java.util.*; public class Geeks { public static void main(String[] args) { HashMap<String, Integer> m = new HashMap<>(); m.put("Geek1", 100); m.put("Geek2", 200); m.put("Geek3", 300); // Convert HashMap key-value pairs into an ArrayList ArrayList<Map.Entry<String, Integer>> al = new ArrayList<>(m.entrySet()); // Print the ArrayList containing key-value pairs System.out.println("Key-Value Pairs: " + al); } }
🌐
ZetCode
zetcode.com › java › collection
Java collection - ArrayList, HashMap, TreeMap, Collections
Java collection tutorial shows how to work with collections in Java. We present ArrayList, HashMap, HashSet, TreeMap, TreeSet, and Collections.
🌐
Guava
guava.dev › releases › 23.0 › api › docs › com › google › common › collect › ArrayListMultimap.html
ArrayListMultimap (Guava: Google Core Libraries for Java 23.0 API)
A HashMap associates each key with an ArrayList of values. When iterating through the collections supplied by this class, the ordering of values for a given key agrees with the order in which the values were added. This multimap allows duplicate key-value pairs.
🌐
CodingTechRoom
codingtechroom.com › question › how-to-create-a-list-of-pairs-in-java-a-step-by-step-guide
How to Create a List of Pairs in Java - CodingTechRoom
import java.util.ArrayList; // Pair class definition class Pair<K, V> { private final K key; private final V value; public Pair(K key, V value) { this.key = key; this.value = value; } public K getKey() { return key; } public V getValue() { return value; } } public class Main { public static void main(String[] args) { ArrayList<Pair<String, Integer>> pairList = new ArrayList<>(); pairList.add(new Pair<>("Alice", 30)); pairList.add(new Pair<>("Bob", 25)); for (Pair<String, Integer> pair : pairList) { System.out.println(pair.getKey() + " is " + pair.getValue() + " years old."); } } }