Map:
1)It is an interface
2)It implement by the HashMap(pre-defined class)
Syntax:
HashMap<> map name=new HashMap();
3)It is to store the pair of keys and values
key-it allows to store unique values
values-it allows to store duplicate values
4)It allow the null values once
5)It consist of methods like (put(),remove(),containvalue(),containkey(),size(),get(),keyset(),values(),entryset())
put()-it is to store the values in a map
get()-it is to get the values in a map by keys
remove()-it is to remove the particular value by using key
containkey()-it is to check if map contains keys
containvalues()-it is to check if map contains value
size()-it is to find the size of the map
keyset()-it is to get only keys in a map,it should be unique
syntax:
setkeyset=map.keySet();
values()-it is to get only values in a map,it can have duplicate values
syntax:
collection collect =map.values();
entrySet()-it is to get both the keys and values,it should be unique
syntax:
Set>entry=map.entrySet();
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)