From the documentation of Map.java -
The
Map.of()andMap.ofEntries()static factory methods provide a convenient way to cre
Well it's very simple. Map.of() is not a varargs method. There are only overloaded Map.of() for up to 10 entries. On the other hand, Map.ofEntries() is a varargs method, hence allowing you to specify as many entries as you want.
They could have just added Map.ofEntries() but since many times you only need just a few entries, they also included the Map.of() versions as convenience methods so that you don't need to wrap each key-valur pair inside an Entry.