We use Map Interface for mapping unique keys and values. By using these keys, we can retrieve the mapping values at any time. Map Interface has so many methods. Some of them are given below :-
clear() : It clears all pairs from the given map.
boolean containsKey(Object thisKey) : It will return true if the map contains thisKey as a key.
boolean containsValue(Object thisValue) : It will return true if the map contains thisValue as a value.
Object put(Object key, Object value): It will add this pairs to the given Map and overwrite the value if
key already exist.
int size() : Returns the number of pairs in the given Map.
0 Comment(s)