想在特定Key的value的基础上+1该怎么实现
例如:
HashMap<String,Integer> a = new HashMap<>; a.put("1",10); a.put("1",a.get("1")+1);
像这样可以吗,还是有什么更好的方法?