Which performance is good? Thank you
The static HashMap
The static Map
CodePudding user response:
Performance difference, because is a reference point to is a hashmap instanceBut consider from the extensibility, the second is better, because the map is the interface, can according to demand changes to different instances of the map, and the first kind is bound to be pointing to a hashmap (because types have identified only a hashmap)