public static void main(String[] args) {
HashMap<String,String> hashMap = new HashMap<>();
hashMap.put("1","2");
String result = hashMap.put("1","3");
System.out.println(result);
}
打印值是2,因为put方法如果已经存在key的话,会返回旧的key所对应的值