Using Map mymap
allows you to change the implementation later. For example, if at some point you need mymap
to be ordered, you just change the initialization to LinkedHashMap
.
↧
Answer by khachik for Why the coding should be "to the interface" especially for primitive datatypes?
↧