I want to create a map Integer to String, and this map order my keys.
so i use :
TreeMap<Integer, String> thm = new TreeMap<Integer, String>();
thm.put(100, "String 1");
thm.put(11, "String 2");
thm.put(100, "String 3");
The problem is when i have two same keys, my TreeMap contains just one ! how to create a TreeMap that cobntains two same kays ? if TreeMap does not resolve my problem what can i do please ?
I read your reply is Guava Tree multi-map but multiMap does not order my keys
You may need to use Guava Tree multi-map for this purpose. Map overrides existing key with new key if it exists.
Example:
Here is a tutorial on how to use mutli-map.