My problem is that I have an Hashtable and I end up with some key having two values. I would like to get both of these value, so I can see which one I want and take it.
Here is an exemple :
Hashtable<String, String> myTable = new Hashtable<>();
myTable.put("key1", "value1");
myTable.put("key1", "value2");
System.out.println(myTable.get("key1"));
//output : value2
How to retrieve both of the value ?
Thank you for your help !
EDIT : In my tests, the HashTable can't store 2 values like this but I assure that in my project where I have a (I believe) code that does the same thing. When, after my algorithm has ran I System.out.prinln(myTable) it does show multiple time the same key with differents value.