[英]How does the put method of ConcurrentHashMap work?
public static ConcurrentHashMap<String,Integer> playersPvpKills = new ConcurrentHashMap<>();
String(key) is player name Integer is the kills(of a game :P ) String(key)是玩家名称Integer是游戏的杀戮(P:P)
well if I use playersPvpKills.add("stackoverflow25", 265);
好吧,如果我使用
playersPvpKills.add("stackoverflow25", 265);
If already exist key stackoverflow25 but has another amount of kills, will it automatically update it to 265? 如果已经存在密钥stackoverflow25,但还有其他原因,它将自动将其更新为265吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.