Explain five methods of map class.

Put(key,value) is used to insert or update a value in map on the basis of key.

Contains key(key) returns true if the key already exists in map else returns false.

Remove(key) removes the key-value pair from the map.

Size() returns the number of elements in map.

Clear() to delete all elements from map at once.

About the author

By Rohit

Recent Posts

Recent Comments