Skip to content

Map2

Further to Map

Useful methods of Map interface

Method Description
V put(Object key, Object value) It is used to insert an entry in the map.
boolean containsKey(Object key) This method returns true if some key equal to the key exists within the map, else return false.
boolean equals(Object o) It is used to compare the specified Object with the Map.
V get(Object key) This method returns the object that contains the value associated with the key.
V getOrDefault(Object key, V defaultValue) It returns the value to which the specified key is mapped, or defaultValue if the map contains no mapping for the key.

Short Video Lecture

(Video here)

VisualCodeChat Tutoring

Interact and Learn with VisualCodeChat!

After-class Exercises

(Exercises here)