Java map value transfer problem

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class Reminder {

    public static void main(String args[]) {
        ArrayList<String> arrStr = new ArrayList<>();
        Map<String,ArrayList<String>> mm = new HashMap<String, ArrayList<String>>();
        arrStr.add("12");
        arrStr.add("23");
        mm.put("1",arrStr);
        Iterator<Map.Entry<String, ArrayList<String>>> at = mm.entrySet().iterator();
        while (at.hasNext()){
            Map.Entry<String, ArrayList<String>> entry=at.next();
            System.err.println(entry.getValue());
        }
        arrStr.set(1,"222");
        Iterator<Map.Entry<String, ArrayList<String>>> at2 = mm.entrySet().iterator();
        while (at2.hasNext()){
            Map.Entry<String, ArrayList<String>> entry=at2.next();
            System.err.println(entry.getValue());
        }
    }
}

Program output:

clipboard.png

as in the code above, when arrStr changes, so does mm. How do you make arrStr change while mm remains the same?

Jul.18,2022

mm.put ("1", new ArrayList (arrStr));


HashMap < Integer, Integer > map = new HashMap < > ();
HashMap < Integer, Integer > map2 = new HashMap < > (map);


change to mm.put ("1", arrStr.clone ()); try.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c27186-33832.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c27186-33832.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?