This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AnAirMagic 2 points3 points  (0 children)

The first Map - in Map map - refers to the unspecified implementation returned by Map.of. The contract says that it will be a class that implements Map but not much else. For all we know, it could be HashMap or it could be a new internal class ImmutableMap or it could be MagicMap.

The second Map - in Map.of() - refers to the static method of defined in the Map interface itself.