设置与地图界面 (Set vs Map interface)
Here, we will see how Map differs from the Set interface in Java and we will see the points given below,
在这里,我们将看到Map与Java中的Set接口有何不同,并且我们将看到以下几点,
地图界面 (Map interface)
The Map is an interface that is defined in java.util package.
Map是在java.util包中定义的接口。
The Map is the data structure in Java.
Map是Java中的数据结构。
The Map is based on Hashing and The Map object is represented in the form of key-value pairs and the key-value pairs are called entry.
Map基于散列,并且Map对象以键值对的形式表示,而键值对称为entry。
The performance of Map interface is high as compare to Set interface.
Map界面的性能比Set界面高。
In the case of Map interface, there is no collision concept if we know keys.
在Map接口的情况下,如果我们知道按键,则不会有冲突概念。
The implementation class of Map interface is HashMap, LinkedHashMap, and ConcurrentHashMap, etc.
Map接口的实现类是HashMap,LinkedHashMap和ConcurrentHashMap等。
The Map is different from Collection or in other words, there is no relation between Map and Collection (i.e. It is not a child interface of Collection interface because Map does not implement Collection interface).
Map与Collection不同,换句话说,Map与Collection之间没有关系(即,它不是Collection接口的子接口,因为Map未实现Co