Implement Maps in java It contains values on the basis of key i.e. key and value pair. Each key and value pair is known as an entry. It contains only unique keys. It is useful if you have to search, update or delete elements on the basis of key. Methods of Map interface · put(Object key,Object value)-inserts an entry into map · get(Object key)-returns value for specified key · remove(Object key)-removes an entry for the specified key · containsKey(Object key)-search specified key from the map · keySet()-returns Set view containing all keys · entrySet()-returns Set view containing all keys and values · putAll(Map m)-inserts specified map in this map . Implementation of Map interface · HashMap · LinkedHashMap · TreeMap TreeMap It implements Map interface using a tree which provides efficient way of storing key/value pairs in sorted or
Charvik provides an education and shares Knowledge to reach your goals.