Wie kommst du auf diese Idee?Ich hätte jetzt erwartet, dass put als Ergebnis das liefert, was als value rein kommt.
Returns the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)
public static void main(String... args) {
Map<String,String> smap = new HashMap();
System.out.println(smap.put("Test","test"));
System.out.println(smap.put("Test","bla :O"));
//Überraschung. Es gibt die null aus weil es noch keinen Wert in der Map gibt den es ausgeben kann ;) Erst beim zweiten mal !!!!
}
Deine Erinnerung hat sich geändert, denn das war noch nie andersIch war mir sicher, dass ich das schon so benutzt habe. Hat sich das irgendwie geändert?