Program to demonstrate "HashMap" class in Java's Collection Framework
The Map interface maps unique keys to values. A key is an object that you use to retrieve a value at a later date. Given a key and a value, you can store the value in a Map object. After the value is stored, you can retrieve it by using its key. It stores value in pairs i.e key and value we can store data using put( ) method and fetch specific data using get( ) method we can print all data using entrySet( ) method. It has following methods: void clear( ) : Removes all key/value pairs from the invoking map. boolean containsKey(Object k) : Returns true if the invoking map contains k as a key. Otherwise, returns false. boolean containsValue(Object v) : Returns true if the map contains v as a value. Otherwise, returns false.