9:01 PM
@Zaid for the default Map interface, yes but...
The method signature gives you an entry point for a threadsafe map (e.g. ConcurrentMap):
The second definition specifies that putIfAbsent will be atomic and will not cause race conditions in a multi-threaded environment.
All that said, I prefer computeIfAbsent for a few reasons (including that it seems to avoid some of the confusion).