When I override the “put(K key, V value)” in a TreeMap, how can I change “value”?
问题 I extend a TreeMap, override "put()", and do something equivalent to: public class MyMap<K, Integer> extends TreeMap<K, Integer> { @Override public Integer put(K key, Integer value) throws ClassCastException, NullPointerException { java.lang.Integer newValue = java.lang.Integer.valueOf(123); super.put(key, newValue); // <--- error message here return newValue; } } error message: no suitable method found for put(K, java.lang.Integer)... java.lang.Integer cannot be converted Integer. I know it