I'm trying to create a list that contains a value and a key, but I want the value to stay the same, and just have multiple keys. So this is just an example:
Map<String, Integer> map = new HashMap<>();
String str = "hey";
for(int i = 0; i < 20; i ++){
map.put(str, i);
}
This is just an example. But how would I go about adding the same string and a different key? Do I need to not use HashMap or it is do-able with it? (because HashMap is not necessary for me, as long as it stores 2 values it's good for me)