I have the code below for a tree map, where I keep a duplicate key and seem to overwrite the existing one.
TreeMap<String, Integer> tm=new TreeMap<>();
tm.put("vivek", 1);
tm.put("vivek", 2);
System.out.println(tm);
He is typing {vivek=2}. So this means that the card allows rewriting based on the key?
source
share