ConcurrentHashMap JDK 8 when to use computeIfPresent

后端 未结 4 1336
粉色の甜心
粉色の甜心 2021-02-01 05:25

The new version of Concurrent Hash Map of jdk 8 has two new Methods.

computeIfAbsent

computeIfPresent

putIfAbs

4条回答
  •  情话喂你
    2021-02-01 06:12

    The JDK hardly ever breaks backwards compatibility. Because then you can not easily port or run software from an older version with the latest version.

    You can run software compiled with an older version of the library with any version (meaning users that have the JRE installed) that still has those functions.

提交回复
热议问题