Map indicates the ing relationship, which is a pair of (Key, value) relationships.
Duplicate key values are not allowed. The relationship between key and value is many-to-one, that is, each value corresponds to a unique key.
Map. entry is the internal structure of the map interface, which is used to save key-value content.
Import Java. util. hashmap; import Java. util. map; import Java. util. set; public class mapdemo {public static void main (string [] ARGs) {map = new hashmap (); map. put (1, "Well"); map. put (2, "Lily"); map. put (3, "Tom"); system. out. println (MAP);/** Boolean containskey (Object key) If this ing contains the ing relationship of the specified key, true * Boolean containsvalue (object Value) is returned) if this ing maps one or more keys to a specified value, true * object get (Object key) is returned to return the value mapped by the specified key. If this ing If the ing relationship does not contain the key, null * object remove (Object key) is returned. If a key ing relationship exists, it is removed from the ing (optional) * Set entryset () returns the set view of the ing relationships contained in the ing. */Set entrys = map. entryset (); For (Object object: entrys) {system. Out. println (object );}}}