تفاوت Map و HashMap ؟
اگر منظور از سوال مقایسه بین انواع مپ هست، قبلا اینجا با جزییات بیشتری درج شده
How Map Is Different From HashMap?
-
HashMap does not maintain any insertion order of its elements hence it is quicker than Map.
-
In contrast to Map, HashMap can hold duplicate values.
-
It’s possible to implement the Map interface by utilizing its implementing classes. Contrariwise implementing the Map interface is what HashMap is all about.
-
The map does not allow storage of a single null key whereas HashMap can store multiple null values along with a single null key.
-
Unlike Map which is an interface, HashMap is a non-synchronized class of the Java Collections framework.
-
HashMap and TreeMap are two implementations of Map whereas the HashMap class uses Map interface.
لینک مرجع: https://www.ksolves.com/blog/java/difference-between-map-and-hashmap-in-java#:~:text=HashMap%20is%20a%20non%2Dsynchronized,to%20map%20key%2Dpair%20values.