{"id":21871943,"url":"https://github.com/avinandanbose/java-collections-map","last_synced_at":"2025-06-14T00:02:54.008Z","repository":{"id":65327397,"uuid":"578928159","full_name":"AvinandanBose/Java-Collections-Map","owner":"AvinandanBose","description":"Here is all about Map of Java","archived":false,"fork":false,"pushed_at":"2023-03-27T21:09:04.000Z","size":391,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T00:02:01.773Z","etag":null,"topics":["java","java10","java4","java5","java6","java7","java8","java9","javacollection","javacollections","javamap","javamapcollections","map","mapping","mappings","maps"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AvinandanBose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-16T08:17:54.000Z","updated_at":"2025-05-28T04:02:50.000Z","dependencies_parsed_at":"2025-04-15T00:00:55.267Z","dependency_job_id":null,"html_url":"https://github.com/AvinandanBose/Java-Collections-Map","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/AvinandanBose/Java-Collections-Map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collections-Map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collections-Map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collections-Map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collections-Map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AvinandanBose","download_url":"https://codeload.github.com/AvinandanBose/Java-Collections-Map/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collections-Map/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259737872,"owners_count":22903869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java10","java4","java5","java6","java7","java8","java9","javacollection","javacollections","javamap","javamapcollections","map","mapping","mappings","maps"],"created_at":"2024-11-28T06:15:52.934Z","updated_at":"2025-06-14T00:02:53.886Z","avatar_url":"https://github.com/AvinandanBose.png","language":"Java","readme":"# Java Collections Map\nHere is all about Map of Java\n\n\u003ch1\u003e1. AbstractMap[Abstract Class] \u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e 1. Every class of Java is inherited  from \u003ci\u003e java.lang.Object \u003c/i\u003e  \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 2. The \u003ci\u003e AbstractMap \u003c/i\u003e class is the base class of the map classes in Java.\u003c/h3\u003e\u003c/li\u003e\n\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.lang.Object-\u003e\u003ejava.util.AbstractMap: \n\n```\n\n\u003cli\u003e \u003ch3\u003e 3. The \u003ci\u003eAbstractMap\u003c/i\u003e class is a part of the Java Collection Framework.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 4.  It directly implements the \u003ci\u003eMap\u003c/i\u003e interface to provide a structure to it.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 5.  \u003ci\u003eAbstractMap\u003c/i\u003e is an abstract class, hence we cannot create \u003ci\u003eAbstractMap\u003c/i\u003e's Object but the concrete classes that inherit from \u003ci\u003eAbstractMap\u003c/i\u003e can be used to create objects .\u003c/h3\u003e\u003c/li\u003e\n\n\u003cbr\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eInterface\u003c/th\u003e\n    \u003cth\u003eHash Table\u003c/th\u003e\n    \u003cth\u003eResizable Array\u003c/th\u003e \n   \u003cth\u003eBalanced Tree\u003c/th\u003e \n   \u003cth\u003eLinked List\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eMap\u003c/td\u003e\n  \u003ctd \u003eHashMap\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeMap\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eSortedMap\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeMap\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eNavigableMap\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeMap\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd colspan=\"5\"\u003eMap.Entry(Inner Class of Map)\u003c/td\u003e\n \n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ch3 align=\"center\"\u003e\n\n```Syntax\n\npublic abstract class AbstractMap\u003cK,V\u003e extends Object, implements Map\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Methods of Abstract Map(Abstract Class) \u003c/h2\u003e\n\n\u003cul\u003e\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003eMethods of Abstract Map(Abstract Class)\u003c/th\u003e\n\u003cth\u003e Does This\u003c/th\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e1. clear() \u003c/td\u003e\n\u003ctd\u003e Removes all of the mappings from this map .\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e2.clone() \u003c/td\u003e\n\u003ctd\u003e Returns a shallow copy of this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e3. containsKey(Object key) \u003c/td\u003e\n\u003ctd\u003e Returns true if this map contains a mapping for the specified key.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e4. containsValue(Object value) \u003c/td\u003e\n\u003ctd\u003eReturns true if this map maps one or more keys to the specified value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e5.entrySet() \u003c/td\u003e\n\u003ctd\u003e Returns a Set view of the mappings contained in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e6. equals(Object o) \u003c/td\u003e\n\u003ctd\u003eCompares the specified object with this map for equality.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e7. get(Object key) \u003c/td\u003e\n\u003ctd\u003eReturns the value to which the specified key is mapped, or null if this map contains no mapping for the key.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e8. hashCode() \u003c/td\u003e\n\u003ctd\u003eReturns the hash code value for this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e9. isEmpty() \u003c/td\u003e\n\u003ctd\u003eReturns true if this map contains no key-value mappings.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e10. keySet()\u003c/td\u003e\n\u003ctd\u003eReturns a Set view of the keys contained in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e11. put(K key, V value) \u003c/td\u003e\n\u003ctd\u003eAssociates the specified value with the specified key in this map .\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e12. putAll(Map\u003c? extends K,? extends V\u003e m) \u003c/td\u003e\n\u003ctd\u003eCopies all of the mappings from the specified map to this map .\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e13. remove(Object key) \u003c/td\u003e\n\u003ctd\u003eRemoves the mapping for a key from this map if it is present.\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003ctd\u003e14.size() \u003c/td\u003e\n\u003ctd\u003eReturns the number of key-value mappings in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e15.toString()\u003c/td\u003e\n\u003ctd\u003eReturns a string representation of this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e16.values()\u003c/td\u003e\n\u003ctd\u003eReturns a Collection view of the values contained in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003ch3\u003e \u003ci\u003e \u003cins\u003e Note: \u003c/ins\u003e These methods are discussed below . \u003c/i\u003e \u003c/h3\u003e\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003ch1 align =\"center\"\u003eA. Map - Interface \u003c/h1\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e1. A \u003ci\u003e map\u003c/i\u003e stores data in Key/Value pairs much like an array.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e2. Every Key/Value pairs stored in indexes .\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e3. Every Key/Value pairs are stored as \u003ci\u003eObjects\u003c/i\u003e in Java.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e4. Typically , \u003ci\u003ekeys\u003c/i\u003e are Strings.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e5. Given a Key and a Value, we can store the value in a \u003ci\u003eMap\u003c/i\u003e object.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e6. After the value is stored , we can retrieve it by using its Key.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e7. Map is generic and is declared : \u003c/h3\u003e\u003c/li\u003e\n\n\u003ch3 align=\"center\"\u003e\n\n```Syntax\n\ninterface Map\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\n\u003ch3\u003e Where, \u003ci\u003eK\u003c/i\u003e specifies the type of keys and \u003ci\u003eV\u003c/i\u003e specifies the type of values. \u003c/h3\u003e\n\n\u003cli\u003e\u003ch3\u003e8. Map do not implement the \u003ci\u003eIterable\u003c/i\u003e interface. Futhermore \u003ci\u003eIterator\u003c/i\u003e also cannot be obtained by a map.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n\n```Syntax\n\nThat is :\n\nimport java.util.Iterator;\nimport  java.lang.Iterable;\n\nIterable\u003cMap\u003cKey, Value\u003e\u003e itr = map; → Cannot be Obtained\n\nOr\n\nIterator\u003cMap\u003cKey, Value\u003e\u003e iterator = map.iterator(); → Cannot be Obtained\n\n```\n\u003c/ul\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eInterface\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eMap\u003c/td\u003e\n  \u003ctd \u003eMaps unique keys to values.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eMap.Entry\u003c/td\u003e\n  \u003ctd \u003eDescribes an element (a key/value) in a map. This is an inner class of Map.\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eNavigableMap\u003c/td\u003e\n  \u003ctd \u003eIt extends SortedMap to handle the retrieval of entries based on closest-match searches.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eSortedMap\u003c/td\u003e\n  \u003ctd \u003eIt extends Map to keep the keys in ascending order.\u003c/td\u003e \n\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Methods of Map Interface \u003c/h2\u003e\n\u003cul\u003e\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003eMethods of Map Interface \u003c/th\u003e\n\u003cth\u003e Does This\u003c/th\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e1. clear() \u003c/td\u003e\n\u003ctd\u003e Removes all of the mappings from this map\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e2. compute(K key, BiFunction\u003c? super K,? super V,? extends V\u003e remappingFunction) \u003c/td\u003e\n\u003ctd\u003e Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e3. computeIfAbsent(K key, Function\u003c? super K,? extends V\u003e mappingFunction) \u003c/td\u003e\n\u003ctd\u003e If the specified key is not already associated with a value (or is mapped to null), attempts to compute its value using the given mapping function and enters it into this map unless null.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e4. computeIfPresent(K key, BiFunction\u003c? super K,? super V,? extends V\u003e remappingFunction) \u003c/td\u003e\n\u003ctd\u003e If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e5. containsKey(Object key) \u003c/td\u003e\n\u003ctd\u003e Returns true if this map contains a mapping for the specified key.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e6. containsValue(Object value) \u003c/td\u003e\n\u003ctd\u003eReturns true if this map maps one or more keys to the specified value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e7. entrySet() \u003c/td\u003e\n\u003ctd\u003eReturns a Set view of the mappings(All Entries) contained in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e8. equals(Object o) \u003c/td\u003e\n\u003ctd\u003eCompares the specified object with this map for equality.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e9. forEach(BiConsumer\u003c? super K,? super V\u003e action) \u003c/td\u003e\n\u003ctd\u003ePerforms the given action for each entry in this map until all entries have been processed or the action throws an exception.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e10. get(Object key) \u003c/td\u003e\n\u003ctd\u003eReturns the value to which the specified key is mapped, or null if this map contains no mapping for the key.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e11. getOrDefault(Object key, V defaultValue) \u003c/td\u003e\n\u003ctd\u003eReturns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e12. hashCode() \u003c/td\u003e\n\u003ctd\u003eReturns the hash code value for this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e13. isEmpty() \u003c/td\u003e\n\u003ctd\u003eReturns true if this map contains no key-value mappings.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e14.keySet() \u003c/td\u003e\n\u003ctd\u003eReturns a Set view of the keys contained in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e15.merge(K key, V value, BiFunction\u003c? super V,? super V,? extends V\u003e remappingFunction) \u003c/td\u003e\n\u003ctd\u003eIf the specified key is not already associated with a value or is associated with null, associates it with the given non-null value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e16.put(K key, V value) \u003c/td\u003e\n\u003ctd\u003eAssociates the specified value with the specified key in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e17.putAll(Map\u003c? extends K,? extends V\u003e m) \u003c/td\u003e\n\u003ctd\u003eCopies all of the mappings from the specified map to this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e18.putIfAbsent(K key, V value) \u003c/td\u003e\n\u003ctd\u003eIf the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e19.remove(Object key)\u003c/td\u003e\n\u003ctd\u003eRemoves the mapping for a key from this map if it is present.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e20.remove(Object key, Object value)\u003c/td\u003e\n\u003ctd\u003eRemoves the entry for the specified key only if it is currently mapped to the specified value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e21.replace(K key, V value)\u003c/td\u003e\n\u003ctd\u003eReplaces the entry for the specified key only if it is currently mapped to some value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e22.replace(K key, V oldValue, V newValue)\u003c/td\u003e\n\u003ctd\u003eReplaces the entry for the specified key only if currently mapped to the specified value.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e23.replaceAll(BiFunction\u003c? super K,? super V,? extends V\u003e function)\u003c/td\u003e\n\u003ctd\u003eReplaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e24.size()\u003c/td\u003e\n\u003ctd\u003eReturns the number of key-value mappings in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e25.values()\u003c/td\u003e\n\u003ctd\u003eReturns a Collection view of the values contained in this map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003ch3\u003e \u003ci\u003e \u003cins\u003e Note: \u003c/ins\u003e These methods are discussed below . \u003c/i\u003e \u003c/h3\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e \u003c/h1\u003e\n\u003ch1\u003e 3. HashMap \u003c/h1\u003e\n\n\u003cul\u003e\n\n\u003ch3\u003e1. HashMap extends Abstract Map abstract class. \u003c/h3\u003e\n\u003ch3\u003e2. As Abstract Map implements Map interface and extends java.lang.Object class , HashMap inherits all of their functions. \u003c/h3\u003e\n\u003cli\u003e \u003ch3\u003e 3. And most imported thing : \"The HashMap provides us an unsorted, unordered Map \".\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 4. HashMap has implementation based on a Hash table.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 5. Duplicate keys are not allowed i.e. Keys are unique .\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 6. Whereas, Duplicate values can be present / allowed .\u003c/h3\u003e\u003c/li\u003e\n\n\n```mermaid\n  \n graph TD;\n    Object--\u003e|extends| AbstractMap;\n    Map--\u003e|implements| AbstractMap;\n    AbstractMap--\u003e|extends| HashMap;\n\n```\n\u003ch2\u003e \u003c/h2\u003e\n\n\u003ch2 align=\"Center\"\u003eConstructors of HashMap \u003c/h2\u003e\n\n\u003cul\u003e\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/map1.java\"\u003e 1.HashMap() \u003c/h3\u003e\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/map2.java\"\u003e 2.HashMap(int initialCapacity) \u003c/h3\u003e\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/map3.java\"\u003e 3.HashMap(int initialCapacity, float loadFactor) \u003c/h3\u003e\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/map3.java\"\u003e 4.HashMap(Map\u003c? extends K, ? extends V\u003e m) \u003c/h3\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eConstructor\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eHashMap()\u003c/td\u003e\n  \u003ctd \u003eIt constructs a new empty map.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eHashMap(int initialCapacity)\u003c/td\u003e\n  \u003ctd \u003eIt constructs a new empty map, with the given initial capacity.\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eHashMap(int initialCapacity, float loadFactor)\u003c/td\u003e\n  \u003ctd \u003eIt constructs a new empty map, with the given initial capacity and  the given load factor.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eHashMap(Map\u003c? extends K, ? extends V\u003e m)\u003c/td\u003e\n  \u003ctd \u003eIt constructs a new  map, with the same mappings as the given map.\u003c/td\u003e \n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/ul\u003e\n\n```Syntax\n\n:ThresHold of HashMap, Capacity and LoadFactor:\n--------------------------------------------------\n\nThresHold of HashMap : \nThe threshold of a HashMap is approximately the product of current capacity and load factor\n\nLoadFactor : \nThe load factor is the measure that decides when to increase the capacity of the Map.\n\nCapacity of HashMap: \nCapacity is the number of buckets in the HashMap. \n\nDefault Capacity of HashMap: 16\nThat is empty HashMap created with capacity 16.\n\nDefault LoadFactor of HashMap: 0.75\nThat is empty HashMap created with Load Factor 0.75.\n\nDefault Threshold of HashMap: is 16 * 0.75 = 12.\nThat is empty HashMap created with threshold 12.\n\n```\n\n![HashMapStructure-660x545](https://user-images.githubusercontent.com/38869235/208160027-ee575296-d999-4a80-898a-b6e69aeccefc.jpg)\n\n\u003ch3\u003e \u003ci\u003e Extras: \u003c/i\u003e \u003c/h3\u003e\n\n```Syntax\n\nIndex: \nIt is the integer value .\nIt is obtained after performing → \nBitwise AND operation on the Value of Hash of the Key and Array Size Minus One.\n\ni.e., :| Index = hashcode(key) \u0026 (ArraySize – 1) |:\n\n\nBucket: It is a LinkedList structure of nodes.\n\n\nNode: It is the elementary unit of a HashMap. \nIt contains the key-value pair and a link to the next node.\n\nNext: Link to the next node.\n\nIt is represented as:  Node\u003cK,V\u003e next.\n\nWhere K represents Key and V represents Value.\n\nRehashing: It is the process of doubling the capacity of the HashMap ,\nafter it reaches its Threshold. In java, HashMap continues to \nrehash(by default) in the following sequence – 2^4, 2^5, 2^6, 2^7, …. so on. \n\n\n\n\n```\n\n![node_hash_map](https://user-images.githubusercontent.com/38869235/208721084-f55b0f8d-15b0-4e81-a90a-919f77b66851.png)\n\n\n\n\u003ch2\u003e \u003c/h2\u003e\n\n\u003ch2 align=\"Center\"\u003eMethods of HashMap \u003c/h2\u003e\n\n\u003cul\u003e\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods1.java\"\u003e 1.Clear \u003c/h3\u003e\n\n```Syntax\n\nIt removes all the mappings of this map.\nThe map will be empty after this call returns.\n\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods2.java\"\u003e 2.Clone \u003c/h3\u003e\n\n```Syntax\nReturns a shallow copy of the HashMap instance provided for cloning\nbut the keys and values themselves are not cloned.\n\n```\n\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods3.java\"\u003e 3.containsKey \u003c/h3\u003e\n\n```Syntax\nReturns true if this map contains a mapping for the specified key.\n\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods4.java\"\u003e 4.containsValue \u003c/h3\u003e\n\n```Syntax\nReturns true if this map maps one or more keys to the specified value.\n\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods5.java\"\u003e 5.forEach \u003c/h3\u003e\n\n```Syntax\nPerforms the given action for each entry in this map \nuntil all entries have been processed or the action throws an exception.\n\n```\n\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods6.java\"\u003e 6.get \u003c/h3\u003e\n  \n```Syntax\n\nSyntax: get(key: Key)\n\nReturns the value to which the specified key is mapped, \nor null if this map contains no mapping for the key.\n\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods7.java\"\u003e 7.getOrDefault\u003c/h3\u003e\n\n```Syntax\n\nSyntax: getOrDefault(key: Key , defaultValue:Value)\n\nReturns the value to which the specified key is mapped, \nor defaultValue if this map contains no mapping for the key.\n\ni.e.,getOrDefault(key:\"One\" , defaultValue:1)\nthen it will return the value for the key : \"One\"\nOr, it will return the value for the value : 1\n\nMost priority given or first search is Key for Value .\nIf not found , then it searches for defaultValue for value.\n\nThat is if \"One\" is not found then it searches for 1.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods8.java\"\u003e 8.isEmpty\u003c/h3\u003e\n\n```Syntax\n\nReturns true if this map contains no key-value mappings.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods9.java\"\u003e 9.KeySet\u003c/h3\u003e\n\n```Syntax\n\nReturns a Set view of the keys contained in this map. \nThe set is backed by the map, \nso changes to the map are reflected in the set, and vice-versa.\n\nNote:\nAs Set\u003cK\u003e keySet()→ Is a Function that returns Set,\nHence, it call all those functions that Set contains,\nSuch as:\n→forEach\n→toArray()\n→remove()\n→removeIf()\n→retainAll()\n→removeAll()\n→Stream()\n→ParallelStream()\n→spliterator()\n→iterator()\n→contains()\n→containsAll()\n...etc.\n\nIt does not support the add or addAll operations.\n```\n\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods10.java\"\u003e 10.Put\u003c/h3\u003e\n\n```Syntax\n\nAssociates the specified value with the specified key in this map. \nIf the map previously contained a mapping for the key, \nthe old value is replaced.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods11.java\"\u003e 11.PutAll\u003c/h3\u003e\n\n```Syntax\n\nCopies all of the mappings from the specified map to this map. \nThese mappings will replace any mappings that this map had ,\nfor any of the keys currently in the specified map.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods12.java\"\u003e 12.Remove(key: Key)\u003c/h3\u003e\n\n```Syntax\nRemoves the mapping for the specified key from this map if present.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods13.java\"\u003e 13.Remove(key: Key, value:Value)\u003c/h3\u003e\n\n```Syntax\nRemoves the entry for the specified key only if it is currently mapped to the specified value.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods14.java\"\u003e 14.Replace(key: Key, oldValue:Value, newValue:Value)\u003c/h3\u003e\n\n```Syntax\nReplaces the entry for the specified key only if currently mapped to the specified value.\nIt replaces old value with new value.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods15.java\"\u003e 15.ReplaceAll(BiFunction function)\u003c/h3\u003e\n\n```Syntax\nReplaces each entry's value with the result of invoking the given function,\non that entry until all entries have been processed or \nthe function throws an exception.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods16.java\"\u003e 16.Size()\u003c/h3\u003e\n\n```Syntax\nReturns the number of key-value mappings in this map.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods17.java\"\u003e 17.values()\u003c/h3\u003e\n\n```Syntax\nReturns a Collection view of the values contained in this map.\n\nNote:\nIterator.remove\nIterator.hasNext()\nIterator.next()\nCollection.remove, \nCollection.removeAll, \nCollection.removeIf,\nCollection.retainAll and \nCollection.clear \n\nlike selected operations is performed,\nas it returns a Collection.\n\nExcept:\n\nIt does not support the add or addAll operations.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods18.java\"\u003e 18.putIfAbsent()\u003c/h3\u003e\n\n```Syntax\nIf the specified key is not already associated with a value ,\nthen associates it with the given value .\n\nIf the specified key is not already associated with a value,\nand now the new value mapped with the new key is NULL , \nthen it will return null. \n```\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods19.java\"\u003e 19.compute(key:Key,BiFunction function)\u003c/h3\u003e\n\n\n```Syntax\nAttempts to compute a mapping for the specified key and \nits current mapped value (or null if there is no current mapping).\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods20.java\"\u003e 20.computeIfAbsent(key:Key, MappingFunction function)\u003c/h3\u003e\n\n\n```Syntax\nIf the specified key is not already associated with a value \n(or is mapped to null), attempts to compute its value,\nusing the given mapping function and\nenters it into this map unless null.\n\nIf the mapping function returns null, no mapping is recorded.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods21.java\"\u003e 21.computeIfPresent(key:Key, BiFunction function)\u003c/h3\u003e\n\n\n```Syntax\nIf the value for the specified key is present and non-null, \nattempts to compute a new mapping given the key \nand its current mapped value.\n\nIf the remapping function returns null, the mapping is removed.\n```\n\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods22.java\"\u003e 22.entrySet()\u003c/h3\u003e\n\n\n```Syntax\nReturns a Set view of the mappings contained in this map. \nThe set is backed by the map, \nso changes to the map are reflected in the set, \nand vice-versa. \n\n\nAs entrySet()→ Is a Function that returns Set,\nHence, it call all those functions that Set contains,\nSuch as:\n→forEach\n→toArray()\n→remove()\n→removeIf()\n→retainAll()\n→removeAll()\n→Stream()\n→ParallelStream()\n→spliterator()\n→iterator()\n→contains()\n→containsAll()\n...etc.\n\nIt does not support the add or addAll operations.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods23.java\"\u003e 22.merge(key:Key, value:Value, BiFunction remappingFunction)\u003c/h3\u003e\n\n\n```Syntax\nIf the specified key is not already associated with a value\nor is associated with null, associates it with the given non-null value. \nOtherwise, replaces the associated value with the results of the given remapping function, \nor removes if the result is null. \n\nThis method may be of use when combining multiple mapped values for a key.\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/mapmethods24.java\"\u003e 24.Replace(key: Key, value:Value)\u003c/h3\u003e\n\n```Syntax\nReplaces the entry for the specified key only if it is currently mapped to some value.\n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eMethods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003e1. Clear\u003c/td\u003e\n  \u003ctd \u003eIt removes all of the mappings from the map.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003e2.Clone\u003c/td\u003e\n  \u003ctd \u003eIt gets a copy of this HashMap instance\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003e3.containsKey\u003c/td\u003e\n  \u003ctd \u003eReturns true if this map contains a mapping for the specified key.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003e4.containsValue\u003c/td\u003e\n  \u003ctd \u003eReturns true if this map maps one or more keys to the specified value.\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e5.forEach\u003c/td\u003e\n  \u003ctd \u003ePerforms the given action for each entry in this map \nuntil all entries have been processed or the action throws an exception.\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e6.get(key: Key)\u003c/td\u003e\n  \u003ctd \u003eReturns the value to which the specified key is mapped, \nor null if this map contains no mapping for the key.\u003c/td\u003e \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd \u003e7.getOrDefault(key: Key , defaultValue:Value)\u003c/td\u003e\n  \u003ctd \u003eReturns the value to which the specified key is mapped, \nor defaultValue if this map contains no mapping for the key.\u003c/td\u003e \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd \u003e8.isEmpty\u003c/td\u003e\n  \u003ctd \u003eReturns true if this map contains no key-value mappings.\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e9.KeySet\u003c/td\u003e\n  \u003ctd \u003eReturns a Set view of the keys contained in this map. \nThe set is backed by the map, \nso changes to the map are reflected in the set, and vice-versa.If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations.\nIt does not support the add or addAll operations.\n\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e10.Put\u003c/td\u003e\n  \u003ctd \u003eAssociates the specified value with the specified key in this map. \nIf the map previously contained a mapping for the key, \nthe old value is replaced.\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e11.PutAll\u003c/td\u003e\n  \u003ctd \u003e Copies all of the mappings from the specified map to this map. \nThese mappings will replace any mappings that this map had ,\nfor any of the keys currently in the specified map.\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e12.Remove(key: Key)\u003c/td\u003e\n  \u003ctd \u003e Removes the mapping for the specified key from this map if present.\u003c/td\u003e \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e13.Remove(key: Key, value:Value)\u003c/td\u003e\n  \u003ctd \u003e Removes the entry for the specified key only if it is currently mapped to the specified value.\n\u003c/td\u003e \n\n\u003ctr\u003e\n  \u003ctd \u003e14.Replace(key: Key, oldValue:Value, newValue:Value)\u003c/td\u003e\n  \u003ctd \u003e Replaces the entry for the specified key only if currently mapped to the specified value.\nIt replaces old value with new value.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e15.ReplaceAll(BiFunction function)\u003c/td\u003e\n  \u003ctd \u003e Replaces each entry's value with the result of invoking the given function,\non that entry until all entries have been processed or \nthe function throws an exception.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e16.Size()\u003c/td\u003e\n  \u003ctd \u003e Returns the number of key-value mappings in this map.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e17.values()\u003c/td\u003e\n  \u003ctd \u003e Returns a Collection view of the values contained in this map.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e18.putIfAbsent()\u003c/td\u003e\n  \u003ctd \u003e If the specified key is not already associated with a value ,\nthen associates it with the given value .\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e19.compute(key:Key,BiFunction function)\u003c/td\u003e\n  \u003ctd \u003e Attempts to compute a mapping for the specified key and \nits current mapped value (or null if there is no current mapping).\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e20.computeIfAbsent(key:Key, MappingFunction function)\u003c/td\u003e\n  \u003ctd \u003e If the specified key is not already associated with a value \n(or is mapped to null), attempts to compute its value,\nusing the given mapping function and\nenters it into this map unless null.\n\nIf the mapping function returns null, no mapping is recorded.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e21.computeIfPresent(key:Key, BiFunction function)\u003c/td\u003e\n  \u003ctd \u003eIf the value for the specified key is present and non-null, \nattempts to compute a new mapping given the key \nand its current mapped value.\n\nIf the remapping function returns null, the mapping is removed.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e22.entrySet()\u003c/td\u003e\n  \u003ctd \u003eReturns a Set view of the mappings contained in this map. \nThe set is backed by the map, \nso changes to the map are reflected in the set, \nand vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations.It does not support the add or addAll operations.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e23.merge(key:Key, value:Value, BiFunction remappingFunction)\u003c/td\u003e\n  \u003ctd \u003eIf the specified key is not already associated with a value\nor is associated with null, associates it with the given non-null value. \nOtherwise, replaces the associated value with the results of the given remapping function, \nor removes if the result is null. \n\nThis method may be of use when combining multiple mapped values for a key.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e24.Replace(key:Key, value:Value)\u003c/td\u003e\n  \u003ctd \u003eReplaces the entry for the specified key only if it is currently mapped to some value.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\u003c/ul\u003e\n\u003ch2 align=\"Center\"\u003eMethods inherited from class java.util.AbstractMap \u003c/h2\u003e\n\u003cul\u003e\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/AbstractMapMethods1.java\"\u003e 1.equals()\u003c/h3\u003e\n\n```Syntax\nCompares the specified object with this map for equality. \nReturns true if the given object is also a map and the two maps represent the same mappings. \n\nMore formally, two maps m1 and m2 represent the same mappings,\nif m1.entrySet().equals(m2.entrySet()).\n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/AbstractMapMethods2.java\"\u003e 2.toString()\u003c/h3\u003e\n\n```Syntax\nReturns a string representation of this map. \n```\n\n\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/AbstractMapMethods3.java\"\u003e 3.hashCode()\u003c/h3\u003e\n\n```Syntax\nReturns the hash code value for this map. \n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eMethods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n  \u003ctd \u003e1.equals()\u003c/td\u003e\n  \u003ctd \u003eCompares the specified object with this map for equality. \nReturns true if the given object is also a map and the two maps represent the same mappings. \n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e2.toString()\u003c/td\u003e\n  \u003ctd \u003eReturns a string representation of this map. \n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003e3.hashCode()\u003c/td\u003e\n  \u003ctd \u003eReturns the hash code value for this map. \n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/ul\u003e\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eNote:\u003c/ins\u003e\u003c/i\u003e Map interface →java.util.Map contains: equals(), forEach(), getOrDefault(), hashCode(), putIfAbsent(), remove(), replace(), replaceAll() \nfunctions inherited by HashMap() have same actions in program . \u003c/h3\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e \u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003e Division of Abstract Map \u003c/h1\u003e\n\n\u003cul\u003e\n\n```mermaid\n \n graph TD;\n    Map--\u003e|implements| AbstractMap;\n    AbstractMap--\u003e|extends| HashMap;\n    AbstractMap--\u003e|extends| IdentityHashMap;\n    AbstractMap--\u003e|extends| WeakHashMap;\n    AbstractMap--\u003e|extends| TreeMap;\n    AbstractMap--\u003e|extends| EnumMap;\n    AbstractMap--\u003e|extends| ConcurrentHashMap;\n    AbstractMap--\u003e|extends| ConcurrentSkipListMap;\n    AbstractMap--\u003e|extends| Object;\n    ConcurrentHashMap--\u003e|implements| ConcurrentMap;\n    ConcurrentSkipListMap--\u003e|implements| ConcurrentNavigableMap;\n    HashMap--\u003e|extends| LinkedHashMap; \n    ConcurrentMap--\u003e|extends| Map;\n    Map--\u003e|extends| SortedMap;\n    SortedMap--\u003e|extends| NavigableMap;\n    TreeMap--\u003e|implements| NavigableMap;\n    ConcurrentNavigableMap--\u003e|extends| ConcurrentMap;\n    ConcurrentNavigableMap--\u003e|extends| NavigableMap;\n    HashTable--\u003e|implements|Map\n ```\n \u003c/ul\u003e \n \n\u003ch1\u003e \u003c/h1\u003e\n\n\u003ch1 align=\"Center\"\u003e Linked Hash Map \u003c/h1\u003e\n\n\u003cul\u003e\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.util.Map-\u003e\u003ejava.util.HashMap:implements \n  java.util.HashMap-\u003e\u003ejava.util.LinkedHashMap:extends\n  \n  \n```\n\n\u003cli\u003e \u003ch3\u003e 1. A LinkedHashMap is an extension of the HashMap class and it implements the Map interface. \u003c/h3\u003e \u003c/li\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class LinkedHashMap\u003cK,​V\u003e extends HashMap\u003cK,​V\u003e implements Map\u003cK,​V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003cli\u003e \u003ch3\u003e 2.The implementation of the LinkedHashMap is very similar to a doubly-linked list. Therefore, each node of the LinkedHashMap is represented as: \u003c/h3\u003e \u003c/li\u003e\n\n![Screenshot (197)](https://user-images.githubusercontent.com/38869235/208919283-fb2e1253-4e47-430b-a3a3-4a6522687238.png)\n\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e\u003cins\u003e\u003ci\u003eHash\u003c/i\u003e\u003c/ins\u003e: All the input keys are converted into a hash which is a shorter form of the key so that the search and insertion are faster.\u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e\u003cins\u003e\u003ci\u003eKey\u003c/i\u003e\u003c/ins\u003e: Since this class extends HashMap, the data is stored in the form of a key-value pair. Therefore, this parameter is the key to the data.\u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e\u003cins\u003e\u003ci\u003eValue\u003c/i\u003e\u003c/ins\u003e: For every key, there is a value associated with it. This parameter stores the value of the keys. Due to generics, this value can be of any form.\u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e\u003cins\u003e\u003ci\u003eNext\u003c/i\u003e\u003c/ins\u003e: Since the LinkedHashMap stores the insertion order, this contains the address to the next node of the LinkedHashMap.\u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e\u003cins\u003e\u003ci\u003ePrevious\u003c/i\u003e\u003c/ins\u003e: This parameter contains the address to the previous node of the LinkedHashMap.\u003c/h3\u003e \u003c/li\u003e\n\n\u003c/ul\u003e\n\n\u003cli\u003e \u003ch3\u003e 3.The implementation of LinkedHashMap is not synchronized. \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 4.It contains only unique elements.\u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 5.It may have one null key and multiple null values.\u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 6.It is the same as HashMap with an additional feature that it maintains insertion order. For example, when we run the code with a HashMap, we get a different order of elements.\u003c/h3\u003e \u003c/li\u003e\n \u003ch3 align=\"Center\"\u003e \u003ci\u003eThat is, It first take elements according to their hash, \u003c/i\u003e\u003c/h3\u003e \n\u003ch3 align=\"Center\"\u003e \u003ci\u003e Then if any insertion occurs it inserts them as (doubly)linked list.\u003c/i\u003e\u003c/h3\u003e \n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConstructors of LinkedHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructLinkedHashMap.java\"\u003e 1.LinkedHashMap()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to construct a default LinkedHashMap.\n\nConstructs an empty insertion-ordered LinkedHashMap instance ,\nwith the default initial capacity (16) and load factor (0.75).\n    \n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructLinkedHashMap1.java\"\u003e 2.LinkedHashMap(int capacity)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize a LinkedHashMap with the given capacity.\n\nConstructs an empty insertion-ordered LinkedHashMap instance ,\nwith the specified initial capacity and a default load factor (0.75).\n    \n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructLinkedHashMap2.java\"\u003e 3.LinkedHashMap(int capacity, float loadFactor)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize both the capacity and the load factor.\n\nConstructs an empty insertion-ordered LinkedHashMap instance,\nwith the specified initial capacity and load factor.\n    \n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructLinkedHashMap3.java\"\u003e 4.LinkedHashMap(int capacity, float loadFactor, boolean accessOrder)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize both the capacity and the load factor with specified ordering mode.\n\nConstructs an empty LinkedHashMap instance ,\nwith the specified initial capacity, load factor and ordering mode.\n    \n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructLinkedHashMap4.java\"\u003e 5.LinkedHashMap(Map\u003c? extends K,? extends V\u003e m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize the LinkedHashMap with the elements from the given Map class m.\n\nConstructs an insertion-ordered LinkedHashMap instance ,\nwith the same mappings as the specified map. \nThe LinkedHashMap instance is created with a default load factor (0.75) \nand an initial capacity sufficient to hold the mappings in the specified map.\n    \n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eConstructor\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n       \n\u003c/tr\u003e \n\n\u003ctr\u003e\n  \u003ctd \u003eLinkedHashMap()\u003c/td\u003e\n  \u003ctd \u003eIt is used to construct a default LinkedHashMap. Constructs an empty insertion-ordered LinkedHashMap instance ,\nwith the default initial capacity (16) and load factor (0.75).\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd \u003eLinkedHashMap(int capacity)\u003c/td\u003e\n  \u003ctd \u003eIt is used to initialize a LinkedHashMap with the given capacity.Constructs an empty insertion-ordered LinkedHashMap instance ,\nwith the specified initial capacity and a default load factor (0.75).\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003eLinkedHashMap(int capacity, float loadFactor)\u003c/td\u003e\n  \u003ctd \u003eIt is used to initialize both the capacity and the load factor.Constructs an empty insertion-ordered LinkedHashMap instance,\nwith the specified initial capacity and load factor.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003eLinkedHashMap(int capacity, float loadFactor, boolean accessOrder)\u003c/td\u003e\n  \u003ctd \u003eIt is used to initialize both the capacity and the load factor with specified ordering mode.Constructs an empty LinkedHashMap instance ,\nwith the specified initial capacity, load factor and ordering mode.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003eLinkedHashMap(Map\u003c? extends K,? extends V\u003e m)\u003c/td\u003e\n  \u003ctd \u003eIt is used to initialize the LinkedHashMap with the elements from the given Map class m.Constructs an insertion-ordered LinkedHashMap instance ,\nwith the same mappings as the specified map. \nThe LinkedHashMap instance is created with a default load factor (0.75) \nand an initial capacity sufficient to hold the mappings in the specified map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\n\u003c/ul\u003e\n\n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of LinkedHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/LinkedHashMap1.java\"\u003e 1. All HashMap and AbstractMap Functions in LinkedHashMap\u003c/h3\u003e\u003c/li\u003e\n\n\u003ch3\u003e New Method : \u003c/h3\u003e\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eMethods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n  \u003ctd \u003eremoveEldestEntry()\u003c/td\u003e\n  \u003ctd \u003eIt is used keep a track of whether the map removes any eldest entry from the map. So each time a new element is added to the LinkedHashMap, the eldest entry is removed from the map. This method is generally invoked after the addition of the elements into the map by the use of put() and putall() method.\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/LinkedHashMap2.java\"\u003e 2. removeEldestEntry()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used keep a track of whether the map removes any eldest entry from the map. \nSo each time a new element is added to the LinkedHashMap, the eldest entry is removed from the map. \nThis method is generally invoked after the addition of the elements into the map,\nby the use of put() and putall() method.\n\nEg:\n\nIf Map = {a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=9, j=10}\n\nThen, removeEldestEntry :\nSize \u003c 1 or Size ==0  → {a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=9, j=10}\nSize \u003e 1 = {j=10}\nSize \u003e 2 = {i=9, j=10}\nSize \u003e 3 = {h=8, i=9, j=10}\n..... etc.\n```\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eSynchronization of LinkedHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e 1.The implementation of LinkedHashMap is not synchronized. \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e2.If multiple threads access a linked hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally.This is typically accomplished by synchronizing on some object that naturally encapsulates the map. \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e3. If no such object exists, the map should be “wrapped” using the \u003ci\u003eCollections.synchronizedMap \u003c/i\u003e method  . This is best done at creation time, to prevent accidental unsynchronized access to the map. \u003c/h3\u003e \u003c/li\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/synchronizedLinkedHashMap.java\"\u003e Synchronized Linked HashMap\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003ch1\u003e \u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003e Identity Hash Map \u003c/h1\u003e\n\n\u003cul\u003e\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.util.Map-\u003e\u003ejava.util.AbstractMap:implements \n  java.util.AbstractMap-\u003e\u003ejava.util.IdentityHashMap:extends\n  java.io.Serializable-\u003e\u003ejava.util.IdentityHashMap:implements \n  java.lang.Cloneable-\u003e\u003ejava.util.IdentityHashMap:implements \n```\n\n\u003cli\u003e \u003ch3\u003e 1. A IdentityHashMap is an extension of the AbstractMap class and it implements the Map interface. \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 2. It is not synchronized and must be synchronized externally. \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 3. It uses reference equality rather than using the equals() method. It uses the == operator. \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 4. Iterators are fail-fast, throw ConcurrentModificationException in an attempt to modify while iterating.ConcurrentModificationException exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.\u003c/h3\u003e \u003c/li\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class IdentityHashMap\u003cK,​V\u003e extends AbstractMap\u003cK,​V\u003e implements Map\u003cK,​V\u003e \n,Serializable, Cloneable \n\n```\n\u003c/h3\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConstructors of IdentityHashMap \u003c/h2\u003e\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructIdentityHashMap.java\"\u003e 1.IdentityHashMap()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nConstructs a new, empty identity hash map with a default expected maximum size (21).\n    \n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructIdentityHashMap1.java\"\u003e 2.IdentityHashMap(int ExpectedMaxSize)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nIt creates a new and empty identity hash map with the given specified expected maximum size.\n\nConstructs a new, empty map with the specified expected maximum size. \nPutting more than the expected number of key-value mappings into the map ,\nmay cause the internal data structure to grow, which may be somewhat time-consuming.\n    \n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructIdentityHashMap2.java\"\u003e 3.IdentityHashMap(Map m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nIt creates a new identity hash map with the key-value pairs given in the specified map.\n\nConstructs a new identity hash map containing the keys-value mappings in the specified map.\n    \n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eConstructor\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n  \u003ctd \u003eIdentityHashMap()\u003c/td\u003e\n  \u003ctd \u003eConstructs a new, empty identity hash map with a default expected maximum size (21).\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003eIdentityHashMap(int ExpectedMaxSize)\u003c/td\u003e\n  \u003ctd \u003eIt creates a new and empty identity hash map with the given specified expected maximum size.\nConstructs a new, empty map with the specified expected maximum size. \nPutting more than the expected number of key-value mappings into the map ,\nmay cause the internal data structure to grow, which may be somewhat time-consuming.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003eIdentityHashMap(Map m)\u003c/td\u003e\n  \u003ctd \u003eIt creates a new identity hash map with the key-value pairs given in the specified map.\n\nConstructs a new identity hash map containing the keys-value mappings in the specified map.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003c/ul\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of IdentityHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/IdentityHashMap1.java\"\u003e 1. All HashMap and AbstractMap Functions in IdentityHashMap\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 2. Difference between HashMap and Identity HashMap.\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/IdentityHashMap2.java\"\u003e  Difference between HashMap and Identity HashMap\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nFor Hash Map:\n\nmap.put(\"a\", 1);\n\na is a String constant and 1 is Integer constant.\n\nmap.put(new String(\"a\"), 2);\n\nHere a is an object of String and 2 is an Integer constant.\n\nBut in HashMap it check key as :\n\nmap.put(\"a\", 1).equals(map.put(new String(\"a\"), 1));\n\ni.e., it treats constant and object is equal as Keys are same i.e. \"a\".\n\ni.e. \"a\".equals(\"a\")\n\nWhich returns true , where as:\n\nFor Identity Hash Map:\n\nmap1.put(\"a\", 1).equals(map1.put(new String(\"a\"), 1))\n\nHere it treats constant and object are different i.e.\n\n\"a\" not equal to {new String(\"a\")}\n\ni.e. it uses:\n\n\"a\" == {new String(\"a\")} which is false\n\nHence it creates : {a=1,a=1} map\n\n\nNow in Identity Hash Map: \n\n map1.put(\"a\", 2); will update,\n 1st Key which have String constant ,\n \n i.e. : {a=2,a=1}\n \nmap1.put(new String(\"a\"), 2); will update,\n2nd Key which have String object ,\n\n i.e. : {a=2,a=2}\n \n While for HashMap:\n map.put(\"a\", 1);\n = {a=1}\n map.put(new String(\"a\"),2}\n =  {a=2}\n map.put(\"a\",3}\n =  {a=3}\n \n .... etc\n \n This is the differnce between Hash Map and Identity Map.\n```\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eSynchronized IdentityHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003ch3\u003e\nWhen more than one threads access the identity hash map concurrently, and at least one of the threads structurally modifies the map, it is necessary to synchronize that map externally. (Structural modification of map is to add or delete one or more key value mappings. If we just change the value associated with a key that an instance contains already is not structural modification.)\n\u003c/h3\u003e\n\n\u003ch3\u003e\nIt can be achieved by synchronizing on any object that encapsulate the map. If such object doesn't exist, map should be wrapped with the help of Collections.synchronizedMap() method. The correct time to do this is at the time of creation, in order to prevent unsynchronized access to map.\n\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/synchronizedIdentityHashMap.java\"\u003e Synchronized Identity HashMap\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eWeak Hash Map \u003c/h1\u003e\n\n\u003cul\u003e\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.util.Map-\u003e\u003ejava.util.AbstractMap:implements \n  java.util.AbstractMap-\u003e\u003ejava.util.WeakHashMap:extends\n  \n  \n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class WeakHashMap\u003cK,V\u003e extends AbstractMap\u003cK,V\u003e implements Map\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003cli\u003e\u003ch3\u003e1. \u003ci\u003e\u003cins\u003eWeakHashMap\u003c/ins\u003e\u003c/i\u003e is an implementation of the Map interface, that stores only weak references to its keys. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e2. Storing only weak references allows a key-value pair to be garbage-collected when its key is no longer referenced outside of the WeakHashMap. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e3. \u003ci\u003e\u003cins\u003eWeakHashMap\u003c/ins\u003e\u003c/i\u003e  does not implement \u003ci\u003e\u003cins\u003eCloneable interface\u003c/ins\u003e\u003c/i\u003e, hence it doesnot have \u003ci\u003e\u003cins\u003eclone()\u003c/ins\u003e\u003c/i\u003e functionality. \u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e4. If object is specified as key doesn’t contain any references- it is eligible for \u003ci\u003e\u003cins\u003eGarbage Collection\u003c/ins\u003e\u003c/i\u003e even though it is associated with \u003ci\u003e\u003cins\u003eWeakHashMap\u003c/ins\u003e\u003c/i\u003e. i.e. \u003ci\u003e\u003cins\u003eGarbage Collector\u003c/ins\u003e\u003c/i\u003e dominates over \u003ci\u003e\u003cins\u003eWeakHashMap\u003c/ins\u003e\u003c/i\u003e. \u003c/h3\u003e\u003c/li\u003e\n\n\n\u003cli\u003e\u003ch3\u003e5. In \u003ci\u003e\u003cins\u003eWeakHashmap\u003c/ins\u003e\u003c/i\u003e, When a key is discarded then its entry is automatically removed from the map, in other words, garbage collected. \u003c/h3\u003e\u003c/li\u003e\n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e \u003ci\u003eWeakReference Vs Strong Reference[on Reference to Hash Map and Weak Map]\u003c/i\u003e \u003c/h2\u003e\n\u003cul\u003e\n\u003ch3\u003e\u003ci\u003e1.Strong Reference:\u003c/i\u003e\u003c/h3\u003e\n\n```Syntax\n\npublic class example {\n    public static void main(String[] args) {\n        example obj = new example();\n        obj = null;\n        System.gc();\n    }\n    \n    \n}\n\n```\n\n\u003ch3\u003e\u003ci\u003eHere \"obj\" object has strong reference to the instance of class \"example\" .\u003c/i\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ci\u003eHence Not eligible for garbage collection until:\u003c/i\u003e\u003c/h3\u003e\n\n\n```Syntax\n\nobj = null \n\n```\n\u003ch3\u003e\u003ci\u003ei.e. The object is garbage collected only when the variable which was strongly referenced points to null.\u003c/i\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ci\u003eAs 'obj' object is no longer referencing to the instance of class: \"example\".\u003c/i\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eBest example:\u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n```Syntax\n\nclass ex{\n    public void finalize(){\n        System.out.println(\"Finalize method called\");\n    }\n}\npublic class example {\n    public static void main(String[] args) {\n        ex obj = new ex();\n        obj.finalize();\n        obj = null;\n        System.gc();//Garbage Collector\n        obj.finalize();//will not call finalize method and throws Null Pointer Exception\n    }\n    \n    \n}\n\n```\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/StrongRefexample.java\"\u003e Strong Reference Example\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eIn HashMap, key objects have strong references. \u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n\u003c/ul\u003e\n\n\u003ch3\u003e\u003ci\u003e2.Weak Reference:\u003c/i\u003e\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e1. This type of reference is used in \u003ci\u003e\u003cins\u003eWeakHashMap\u003c/ins\u003e\u003c/i\u003e to reference the entry objects . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e2. If JVM detects an object with only weak references (i.e. no strong or soft references linked to any object), this object will be marked for garbage collection. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e3. To create such references \u003ci\u003e\u003cins\u003ejava.lang.ref.WeakReference\u003c/ins\u003e\u003c/i\u003e class is used. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e4. Weak Reference Objects are not the default type/class of Reference Object. They are explicitly specified while using them.\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nimport java.lang.ref.WeakReference;\n\nclass exceptions {\n    void print() {\n        System.out.println(\"Print method called\");\n    }\n}\n\npublic class WeakRefexample {\n    public static void main(String[] args) {\n\n        // Strong Reference\n        exceptions obj = new exceptions();\n        obj.print();\n\n        // Weak Reference has explicit type class[exceptions] of Reference Object[obj]\n        WeakReference\u003cexceptions\u003e weak = new WeakReference\u003c\u003e(obj); \n\n        obj = null;\n        exceptions obj1 = weak.get();\n\n        /**\n         * \n         * get() function : It returns this reference object's referent.\n         * If this reference object has been cleared,\n         * either by the program or by the garbage collector,\n         * then this method returns null.\n         * \n         **/\n\n        obj1.print(); // will call print method and will not throw any exceptions\n    }\n\n}\n\n```\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/WeakRefexample.java\"\u003e Weak Reference Example\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConstructors of WeakHashMap \u003c/h2\u003e\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructWeakHashMap.java\"\u003e 1.WeakHashMap()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to construct a default constructor of WeakHashMap.\n\nThis constructor constructs a new, \nempty WeakHashMap with the default initial capacity (16) \nand the default load factor (0.75).\n    \n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructWeakHashMap1.java\"\u003e 2.WeakHashMap(int initialCapacity)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nThis constructor constructs a new, \nempty WeakHashMap with the given \ninitial capacity and \nthe default load factor, which is 0.75.\n    \n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructWeakHashMap2.java\"\u003e 3.WeakHashMap(int initialCapacity, float loadFactor)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nThis constructor constructs a new, empty WeakHashMap \nwith the given initial capacity and the given load factor.\n    \n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructWeakHashMap3.java\"\u003e 4.WeakHashMap(Map m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nThis constructor constructs a new WeakHashMap ,\nwith the same mappings as the specified Map.\n    \n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eConstructor\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eWeakHashMap()\u003c/td\u003e\n  \u003ctd \u003eIt is used to construct a default constructor of WeakHashMap.This constructor constructs a new, \nempty WeakHashMap with the default initial capacity (16) \nand the default load factor (0.75).\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd \u003eWeakHashMap(int initialCapacity)\u003c/td\u003e\n  \u003ctd \u003eThis constructor constructs a new, \nempty WeakHashMap with the given \ninitial capacity and \nthe default load factor, which is 0.75.\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd \u003eWeakHashMap(int initialCapacity, float loadFactor)\u003c/td\u003e\n  \u003ctd \u003eThis constructor constructs a new, empty WeakHashMap \nwith the given initial capacity and the given load factor.\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd \u003eWeakHashMap(Map m)\u003c/td\u003e\n  \u003ctd \u003eThis constructor constructs a new WeakHashMap ,\nwith the same mappings as the specified Map.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/ul\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of WeakHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/weakHashMap1.java\"\u003e 1.All Weak HashMap Methods\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/weakhashmap2.java\"\u003e 2. Weak HashMap Vs Hash Map\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nConsider a Class:\n\nclass demo{\n    @Override\n    public String toString() {\n        return \"demo\";\n    }\n    public void finalize(){\n        System.out.println(\"Finalize method called\");\n    }\n\n}\n\nNow:\n\nclass weakhashmap2{\n public static void main(String[] args){\n  WeakHashMap\u003cObject, Integer\u003e map = new WeakHashMap\u003c\u003e();\n  demo d = new demo();\n  map.put(d, 1);\n   \n   Now:\n   \n   : Object is assigned to null :\n   \n   d = null;\n   \n   : And , Grabage Collector is called :\n   \n    System.gc();\n    \n    : Which will empty the Map as it is a Weak Reference :\n    : As, Weak Reference is cleared by gc :\n    \n    Next:\n    We input Key as d and an integer 1 in the map:\n    map.put(d, 1);\n    we know d has already assigned to null hence the output: Map:{null=1}\n    \n    Now we create another object say :\n    demo d2 = new demo();\n    map.put(d2, 2);\n    \n    So output will be: Map:{null=1,  demo=2}\n    \n    : Hence it signifies the WeakReference of Key, Value pair in Weak HashMap. :\n    \n    : But in Hash Map : \n    \n    HashMap\u003cObject, Integer\u003e m = new HashMap\u003c\u003e();\n    demo d1 = new demo();\n    m.put(d1, 1);\n    \n    :Output: Map = {demo=1}\n    \n    d1 = null;//Object is referenced to null.\n    System.gc();//garbage collector is called.\n    \n    :And again if map is called:\n    :It will put Object → d1 and Integer→ 1 : \n    :As HashMap is strongly referenced to Object → d1 and Integer→ 1:\n    \n    System.out.println( m);\n    \n    :Output →  {demo=1}:\n    \n     Now we create another object say :\n     demo d3 = new demo();\n     m.put(d3, 2);\n     System.out.println( m);\n      \n     :Output: Map = {demo=1, demo=2}\n     \n     :Note → d1,d2,d3 are different Objects of demo class :\n     :And are reffered to here as different keys : \n     :For both HashMap and WeakHashMap : \n     \n     \n  }\n}\n   \n\n```\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eB.Sorted Map - Interface\u003c/h1\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.SortedMap-\u003e\u003ejava.util.Map:extends\n  \n```\n\n\u003ch3 align=\"center\"\u003e\n\n```Syntax\n\npublic interface SortedMap\u003cK, V\u003e extends Map\u003cK, V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e SortedMap is an interface in the collection framework. \u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003eThis interface extends the Map interface and provides a total ordering of its elements ,\n(elements can be traversed in sorted order of keys). \u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003eThe class that implements this interface is TreeMap.\u003c/h3\u003e\u003c/li\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of Sorted Map - Interface\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e1.Comparator() - Example\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap1.java\"\u003e 1.Comparator - Eg (1)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap2.java\"\u003e 2.Comparator - Eg (2)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap8.java\"\u003e 3.Comparator - Eg (3)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap9.java\"\u003e 4.Comparator - Eg (4)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap10.java\"\u003e 5.Comparator - Eg (5)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap11.java\"\u003e 6.Comparator - Eg (6)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nComparator:\nA comparison function, which imposes a total ordering on some collection of objects. \nComparators can also be used to control the order of  sorted maps .\n\nHere: \nIt returns the comparator used to order the keys in this map, \nor null if this map uses the natural ordering of its keys.\n\n```\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap3.java\"\u003e 2.FirstKey()\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns the first (lowest) key currently in this map.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap4.java\"\u003e 3.LastKey()\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns the last (highest) key currently in this map.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap5.java\"\u003e 4.HeadMap(toKey:Key)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nheadMap(toKey:Key) : \nReturns a view of the portion of this map whose keys are strictly less than toKey.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap6.java\"\u003e 5.TailMap(fromKey:Key)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\ntailMap(fromKey:Key) : \nReturns a view of the portion of this map whose keys are greater than and equal to fromKey.\n\n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/SortedMap7.java\"\u003e 6.SubMap(fromKey:Key, toKey:Key)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a view of the portion of this map whose keys range from fromKey, inclusive, \ni.e. including fromKey and to toKey, exclusive i.e. excluding toKey.\n\n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eMethods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e1.Comparator()\u003c/td\u003e\n    \u003ctd\u003e\n\nA comparison function, which imposes a total ordering on some collection of objects. \nComparators can also be used to control the order of  sorted maps .\nHere,It returns the comparator used to order the keys in this map, \nor null if this map uses the natural ordering of its keys.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e2.FirstKey()\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the first (lowest) key currently in this map.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e3.LastKey()\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the last (highest) key currently in this map.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e4.HeadMap(toKey:Key)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a view of the portion of this map whose keys are strictly less than toKey.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e5.TailMap(fromKey:Key)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a view of the portion of this map whose keys are greater than and equal to fromKey.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e6.SubMap(fromKey:Key, toKey:Key)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a view of the portion of this map whose keys range from fromKey, inclusive, \ni.e. including fromKey and to toKey, exclusive i.e. excluding toKey.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003ch3\u003e \u003ci\u003e \u003cins\u003eNote: \u003c/ins\u003e SortedMap interface extends Map interface , hence it also inherits all functions from Map interface. \u003c/i\u003e\u003c/h3\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eC.Navigable Map - Interface\u003c/h1\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.NavigableMap-\u003e\u003ejava.util.SortedMap:extends \n  java.util.SortedMap-\u003e\u003ejava.util.Map:extends\n  \n```\n\n\n\u003ch3 align=\"center\"\u003e\n\n```Syntax\n\npublic interface NavigableMap\u003cK,V\u003e extends SortedMap\u003cK,V\u003e\n\npublic interface SortedMap\u003cK, V\u003e extends Map\u003cK, V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e The NavigableMap interface is a member of the Java Collection Framework. \u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003eA NavigableMap can be easily accessed and traversed in either ascending or descending key order. \u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003eIt belongs to java.util package and It is an extension of SortedMap which provides convenient navigation methods.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003eAs it extends Sorted Map , hence methods of all Sorted Map interface can be accessed by Navigable Map .\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003eThese Navigation Methods  are discussed below.\u003c/h3\u003e\u003c/li\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"center\" \u003e Methods of Navigable Map \u003c/h2\u003e\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap1.java\"\u003e 1.ceilingEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a key-value mapping associated with the least key greater than \nor equal to the given key, or null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap2.java\"\u003e 2.ceilingKey\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns the least key greater than or equal to the given key, \nor null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap3.java\"\u003e 3.descendingKeySet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a reverse order NavigableSet view of the keys contained in this map.\nThe set's iterator returns the keys in descending order. \nThe set is backed by the map, so changes to the map are reflected in the set, and vice-versa. \nIf the map is modified while an iteration over the set is in progress \n(except through the iterator's own remove operation), the results of the iteration are undefined. \nThe set supports element removal, which removes the corresponding mapping from the map, \nvia the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. \n\n:It does not support the add or addAll operations:\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap4.java\"\u003e 4.descendingMap\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a reverse order view of the mappings contained in this map. \n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap5.java\"\u003e 5.firstEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a key-value mapping associated with the least key in this map, \nor null if the map is empty.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap6.java\"\u003e 6.floorEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a key-value mapping associated with the greatest key less than \nor equal to the given key, or null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap7.java\"\u003e 7.floorKey\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns the greatest key less than or equal to the given key,\nor null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap8.java\"\u003e 8.headMap(K toKey, boolean inclusive)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a view of the portion of this map whose keys are less than \n(or equal to, if inclusive is true) toKey.\n\nif true:\nReturns a view of the portion of this map whose keys are equal to toKey,if inclusive is true.\n\nif false:\nReturns a view of the portion of this map whose keys are less than toKey,if inclusive is false.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap9.java\"\u003e 9.higherEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a key-value mapping associated with the least key strictly greater than the given key,\nor null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap10.java\"\u003e 10.higherKey\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns the least key strictly greater than the given key, or null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap11.java\"\u003e 11.lastEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a key-value mapping associated with the greatest key in this map, \nor null if the map is empty.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap12.java\"\u003e 12.lowerEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns a key-value mapping associated with the greatest key strictly less than the given key, \nor null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap13.java\"\u003e 13.lowerKey\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nReturns the greatest key strictly less than the given key, or null if there is no such key.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap14.java\"\u003e 14.navigableKeySet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a NavigableSet view of the keys contained in this map. \nThe set's iterator returns the keys in ascending order. \nThe set is backed by the map, so changes to the map are reflected in the set, and vice-versa. \nThe set supports element removal, which removes the corresponding mapping from the map, \nvia the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. \n\n\n:It does not support the add or addAll operations:\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap15.java\"\u003e 15.pollFirstEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nRemoves and returns a key-value mapping associated with the least key in this map, \nor null if the map is empty.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap16.java\"\u003e 16.pollLastEntry\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nRemoves and returns a key-value mapping associated with the greatest key in this map, \nor null if the map is empty.\n\n```\n\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap17.java\"\u003e 17.SubMap( fromKey:Key, boolean fromInclusive:true/false, toKey:Key, boolean toInclusive:true/false)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a view of the portion of this map whose keys range from fromKey to toKey. \nIf fromKey and toKey are equal, the returned map is empty \nunless fromInclusive and toInclusive are both true.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/NavigableMap18.java\"\u003e 18.tailMap(fromKey :Key, boolean inclusive: true/false)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a view of the portion of this map whose keys are greater than, \n(or equal to, if inclusive is true) fromKey.\n\n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eMethods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003e1.ceilingEntry\u003c/td\u003e\n  \u003ctd \u003e\nReturns a key-value mapping associated with the least key greater than \nor equal to the given key, or null if there is no such key.\n\n\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003e2.ceilingKey\u003c/td\u003e\n  \u003ctd \u003e\nReturns the least key greater than or equal to the given key, \nor null if there is no such key.\n\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd \u003e3.descendingKeySet\u003c/td\u003e\n  \u003ctd \u003e\n\nReturns a reverse order NavigableSet view of the keys contained in this map.\nThe set's iterator returns the keys in descending order. \nThe set is backed by the map, so changes to the map are reflected in the set, and vice-versa. \nIf the map is modified while an iteration over the set is in progress \n(except through the iterator's own remove operation), the results of the iteration are undefined. \nThe set supports element removal, which removes the corresponding mapping from the map, \nvia the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. \nIt does not support the add or addAll operations.\n\n\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003ctd\u003e4.descendingMap\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a reverse order view of the mappings contained in this map.\n\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e5.firstEntry\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a key-value mapping associated with the least key in this map, \nor null if the map is empty.\n\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e6.floorEntry\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a key-value mapping associated with the greatest key less than \nor equal to the given key, or null if there is no such key.\n\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e7.floorKey\u003c/td\u003e\n\n\u003ctd\u003e\nReturns the greatest key less than or equal to the given key,\nor null if there is no such key.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd\u003e8.headMap(K toKey, boolean inclusive)\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a view of the portion of this map whose keys are less than \n(or equal to, if inclusive is true) toKey.\n\nif true:\nReturns a view of the portion of this map whose keys are equal to toKey,if inclusive is true.\n\nif false:\nReturns a view of the portion of this map whose keys are less than toKey,if inclusive is false.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e9.higherEntry\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a key-value mapping associated with the least key strictly greater than the given key,\nor null if there is no such key.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e10.higherKey\u003c/td\u003e\n\n\u003ctd\u003e\nReturns the least key strictly greater than the given key, or null if there is no such key.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e11.lastEntry\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a key-value mapping associated with the greatest key in this map, \nor null if the map is empty.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e12.lowerEntry\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a key-value mapping associated with the greatest key strictly less than the given key, \nor null if there is no such key.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e13.lowerKey\u003c/td\u003e\n\n\u003ctd\u003e\nReturns the greatest key strictly less than the given key, or null if there is no such key.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e14.navigableKeySet\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a NavigableSet view of the keys contained in this map. \nThe set's iterator returns the keys in ascending order. \nThe set is backed by the map, so changes to the map are reflected in the set, and vice-versa. \nThe set supports element removal, which removes the corresponding mapping from the map, \nvia the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. \nIt does not support the add or addAll operations.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e15.pollFirstEntry\u003c/td\u003e\n\n\u003ctd\u003e\nRemoves and returns a key-value mapping associated with the least key in this map, \nor null if the map is empty.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \u003ctd\u003e16.pollLastEntry\u003c/td\u003e\n\n\u003ctd\u003e\nRemoves and returns a key-value mapping associated with the greatest key in this map, \nor null if the map is empty.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd\u003e17.SubMap( fromKey:Key, boolean fromInclusive:true/false, toKey:Key, boolean toInclusive:true/false)\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a view of the portion of this map whose keys range from fromKey to toKey. \nIf fromKey and toKey are equal, the returned map is empty \nunless fromInclusive and toInclusive are both true.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \u003ctd\u003e18.tailMap(fromKey :Key, boolean inclusive: true/false)\u003c/td\u003e\n\n\u003ctd\u003e\nReturns a view of the portion of this map whose keys are greater than, \n(or equal to, if inclusive is true) fromKey.\n\u003c/td\u003e\n \n\u003c/tr\u003e\n\u003c/table\u003e\n\n\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eTree Map\u003c/h1\u003e \n\n\u003cul\u003e\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.util.Map-\u003e\u003ejava.util.AbstractMap:implements \n  java.util.AbstractMap-\u003e\u003ejava.util.TreeMap:extends\n  java.util.Map-\u003e\u003ejava.util.SortedMap:extends\n  java.util.SortedMap-\u003e\u003ejava.util.NavigableMap:extends\n  java.util.NavigableMap-\u003e\u003ejava.util.TreeMap:implements\n  java.io.Serializable-\u003e\u003ejava.util.TreeMap:implements \n  java.lang.Cloneable-\u003e\u003ejava.util.TreeMap:implements \n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class TreeMap\u003cK,V\u003e extends AbstractMap\u003cK,V\u003e\n                          implements NavigableMap\u003cK,V\u003e,Cloneable,Serializable\n\npublic interface NavigableMap\u003cK,V\u003e extends SortedMap\u003cK,V\u003e\n\npublic interface SortedMap\u003cK,V\u003e extends Map\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003cli\u003e \u003ch3\u003e1. The TreeMap in Java is used to implement Map interface . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e2. The TreeMap in Java is used to implement  NavigableMap interface . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e3. The TreeMap in Java is used to extend the abstract class :  \u003ci\u003e\"AbstractMap\"\u003c/i\u003e . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e4.TreeMap in Java does not allow null keys (like Map) and thus a NullPointerException is thrown.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e5.Multiple null values can be associated with different keys in Tree Map.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e6.TreeMap contains only unique elements.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e7.TreeMap is non synchronized.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e8.TreeMap maintains ascending order. As Tree Map implements \u003ci\u003e\" Navigable Map\" \u003c/i\u003e and Navigable Map extends Sorted Map.\nHence tree map maintains sorted structure of map i.e. in ascending order.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e9.\u003ci\u003e\" Entry pairs \" \u003c/i\u003e returned by the methods in this class and its views represent snapshots of mappings at the time they were produced. \u003ci\u003e\" Entry.SetValue \"\u003c/i\u003e  is only supported when we try to change every specific values of the keys through a loop , But do not support the \u003ci\u003e\" Entry.setValue \"\u003c/i\u003e method for individual entries.And they throw \u003ci\u003e \"Unsupported Operation Exception\" .\u003c/i\u003e \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e10.TreeMap is based upon a red-black tree data structure.( Red Black Trees are self-balancing, meaning that the tree adjusts itself automatically after each insertion or deletion operation. )\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap.java\"\u003eEntry.SetValue in TreeMap → Eg\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConstructors of TreeMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap1.java\"\u003e 1.TreeMap()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nIt is used to construct a default constructor of TreeMap.\n\nIt is used to construct an empty tree map,\nthat will be sorted using the natural order of its key.\n    \n```\n\u003ch3\u003e2. TreeMap(Comparator\u003c? super K\u003e comparator) \u003c/h3\u003e\n\n```Syntax\nIt is used to construct an empty tree-based map,\nthat will be sorted using the comparator. \n    \n```\n\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap2.java\"\u003e 2.a.TreeMap(Comparator\u003c? super K\u003e comparator)→Eg:1\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nAcc. to above eg:\n\nTreeMap2(no:1, name:\"one\", value:1)\n\no1 and o2 are two object of TreeMap2,\n\nTherefore Comparison:\n\no1.value - o2.value,\ni.e,1st Diff: 1-1 = 0\n\nTreeMap2(no:2, name:\"two\", value:2)\n\nTherefore Comparison:\n\n2nd Difference: 2-1 = 1\n\nTreeMap2(no:3, name:\"three\", value:3)\n\no1.value: 3 - o2.value: 1 = 2\n\no1.value: 3 - o2.value: 2 = 1\n\nTreeMap2(no:4, name:\"four\", value:4)\n\no1.value: 4 - o2.value: 2 = 2\n\no1.value: 4 - o2.value: 3 = 1\n\nSimilary:\nTreeMap2(no:5, name:\"five\", value:5)\n\no1.value: 5 - o2.value: 2 = 3\n\no1.value: 5 - o2.value: 3 = 2\n\no1.value: 5 - o2.value: 4 = 1\n\n\n....etc.\n\nHence:\n\nif we see the comparison:\n\n0 1 2 3 4 5 in ascending order.\n\nHence Result is in  ascending order.\n\n```\n\n\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap3.java\"\u003e 2.b.TreeMap(Comparator\u003c? super K\u003e comparator)→Eg:2\u003c/h3\u003e\u003c/li\u003e\n\n\n\n```Syntax\n\nAcc. to above eg:\n\nTreeMap2(no:1, name:\"one\", value:1)\n\no1 and o2 are two object of TreeMap2,\n\nTherefore Comparison:\n\no2.value - o1.value,\ni.e,1st Diff: 1-1 = 0\n\nTreeMap2(no:2, name:\"two\", value:2)\n\nTherefore Comparison:\n\n2nd Difference: 1-2 = -1\n\nTreeMap2(no:3, name:\"three\", value:3)\n\no2.value: 1 - o1.value: 3 = -2\n\no2.value: 2 - o1.value: 1 = -1\n\nTreeMap2(no:4, name:\"four\", value:4)\n\no2.value: 2 - o1.value: 4 = -2\n\no2.value: 3 - o1.value: 4 = -1\n\nSimilary:\nTreeMap2(no:5, name:\"five\", value:5)\n\no2.value: 2 - o2.value: 5 = -3\n\no2.value: 3 - o2.value: 5 = -2\n\no2.value: 4 - o2.value: 5 = -1\n\n\n....etc.\n\nHence:\n\nif we see the comparison:\n\n-5 -4 -3 -2 -1 0 in descending order.\n\nHence Result is in descending order.\n\n```\n\n\u003c/ul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap4.java\"\u003e 3.TreeMap(Map\u003c? extends K,? extends V\u003e m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize a treemap with the entries from object of Map, \nwhich will be sorted using the natural order of the keys.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap5.java\"\u003e 4.TreeMap(SortedMap\u003cK,? extends V\u003e m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize a treemap with the entries from object of SortedMap, \nwhich will be sorted using the natural order of the keys.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMap6.java\"\u003e 5.TreeMap(NavigableMap\u003cK,? extends V\u003e m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to initialize a treemap with the entries from object of NavigableMap, \nwhich will be sorted using the natural order of the keys.\n\nNote :  NavigableMap extends SortedMap\nAnd : TreeMap implements NavigableMap\n\n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eConstructor\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e1.TreeMap()\u003c/td\u003e\n    \u003ctd\u003e\n\nIt is used to construct a default constructor of TreeMap.\n\nIt is used to construct an empty tree map,\nthat will be sorted using the natural order of its key.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e2.TreeMap(Comparator\u003c? super K\u003e comparator)\u003c/td\u003e\n    \u003ctd\u003e\n\nIt is used to construct an empty tree-based map,\nthat will be sorted using the comparator. \n\n\u003c/td\u003e\n      \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e3.TreeMap(Map\u003c? extends K,? extends V\u003e m)\u003c/td\u003e\n    \u003ctd\u003e\n\nIt is used to initialize a treemap with the entries from object of Map, \nwhich will be sorted using the natural order of the keys.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e4.TreeMap(SortedMap\u003cK,? extends V\u003e m)\u003c/td\u003e\n    \u003ctd\u003e\n\nIt is used to initialize a treemap with the entries from object of SortedMap, \nwhich will be sorted using the natural order of the keys.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e5.TreeMap(NavigableMap\u003cK,? extends V\u003e m)\u003c/td\u003e\n    \u003ctd\u003e\n\nIt is used to initialize a treemap with the entries from object of NavigableMap, \nwhich will be sorted using the natural order of the keys.\n\nNote :  NavigableMap extends SortedMap,\nAnd : TreeMap implements NavigableMap.\n\n\u003c/td\u003e\n      \n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003c/ul\u003e\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of TreeMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMapMethods.java\"\u003e 1.TreeMap Methods\u003c/h3\u003e\u003c/li\u003e\n\u003ch3\u003e\u003cins\u003e\u003ci\u003eNote:\u003c/ins\u003e These methods are already part of WeakHashMap , IdentityHashMap and HashMap .\u003c/i\u003e \u003c/h3\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMapMethods2.java\"\u003e 2.TreeMap Methods[Sorted Map Interface Methods]\u003c/h3\u003e\u003c/li\u003e\n\u003ch3\u003e\u003cins\u003e\u003ci\u003eNote:\u003c/ins\u003e These methods are already part of Sorted Map Interface Methods, as TreeMap implements NavigableMap and NavigableMap extends SortedMap .\u003c/i\u003e \u003c/h3\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/TreeMapMethods3.java\"\u003e 3.TreeMap Methods[Navigable Map Interface Methods]\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nSuppose we have descendingKeySet() or navigableKeySet() functions:\n\nThen:\n\nThe Set that will be produced by those function can be reserved in Set variable/object.\n\n1. Set\u003cType\u003e set_var = TreeMap.navigableKeySet();\n\n2. Set\u003cType\u003e set_var = TreeMap.descendingKeySet();\n\nSimilary for Entry say, lastEntry() or pollFirstEntry():\n\nThen: \n\nIt calls for Maps.Entry and reserves such entries under its variable/object.\n\ni.e. \nImport java.util.Map.Entry;\nEntry\u003cType1, Type2\u003e entry_var = TreeMap.pollLastEntry();\n\nor:\nMap.Entry \u003cType1, Type2\u003e entry_var = TreeMap.pollLastEntry();\n\nSimilary for tailMap() or subMap() type Functions:\n\nThey are always stored under the Map object/variable.\n\ni.e.\n\n Map\u003cType1, Type2\u003e map_var = TreeMap.tailMap(fromKey:Key, inclusive: true/false);\n \n If we want to store any key object then it can be store under it's type varibale:\n \n Eg:\n TreeMap\u003cFloat, String\u003e treeMap = new TreeMap\u003c\u003e();\n Float float_var = treeMap.lowerKey(4.0f);\n\n```\n\n\u003ch3\u003e\u003cins\u003e\u003ci\u003eNote:\u003c/ins\u003e These methods are already part of Navigable Map Interface Methods, as TreeMap implements NavigableMap  .\u003c/i\u003e \u003c/h3\u003e\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eSynchronization of TreeMap \u003c/h2\u003e\n\u003cul\u003e\n\u003ch3\u003e\nThe implementation of a TreeMap is not synchronized. This means that if multiple threads access a tree set concurrently, and at least one of the threads modifies the set, it must be synchronized externally. This is typically accomplished by using the \u003ci\u003e\u003cins\u003eCollections.synchronizedSortedMap\u003c/ins\u003e\u003c/i\u003e method. Also it can be locked by \u003ci\u003e\u003cins\u003esynchronized()\u003c/ins\u003e\u003c/i\u003e method and all such map objects can execute synchronized in a single thread.\n\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/synchronizedTreeMap.java\"\u003e SynchronizedTreeMap\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eEnum Map \u003c/h1\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.EnumMap-\u003e\u003ejava.util.AbstractMap:extends \n  java.util.EnumMap-\u003e\u003ejava.io.Serializable:implements\n  java.util.EnumMap-\u003e\u003ejava.io.Cloneable:implements\n  java.util.AbstractMap-\u003e\u003ejava.util.Map:implements\n  java.util.AbstractMap-\u003e\u003ejava.lang.Object:extends\n\n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class EnumMap\u003cK extends Enum\u003cK\u003e,​V\u003e \n                    extends AbstractMap\u003cK,​V\u003e \n                    implements Serializable, Cloneable\n\npublic abstract class AbstractMap\u003cK,V\u003e extends Object, implements Map\u003cK,V\u003e\n\n```\n\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e1. EnumMap class is a member of the Java Collections Framework .\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e2. EnumMap extends AbstractMap and AbstractMap (abstract class) implement Map Interface.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e3. EnumMap doesn’t allow null key and throws NullPointerException .\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e4. All keys of each EnumMap instance must be keys of a single enum(enumeration) type.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e5.It’s a high-performance map implementation, much faster than HashMap.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e6.\u003ci\u003e\u003cins\u003eIterators\u003c/ins\u003e\u003c/i\u003e returned by the collection views are weakly consistent: they will never throw \u003ci\u003e\u003cins\u003eConcurrentModificationException\u003c/ins\u003e\u003c/i\u003e and they may or may not show the effects of any modifications to the map that occur while the iteration is in progress.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e7.EnumMap is internally represented as arrays. This representation is extremely compact and efficient.\u003c/h3\u003e\u003c/li\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Constructors of EnumMap\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/EnumMapConst1.java\"\u003e1. EnumMap(Class keyType)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates an empty enum map with the specified key type.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/EnumMapConst2.java\"\u003e2. EnumMap(EnumMap m)\u003c/h3\u003e\u003c/li\u003e\n\n\n```Syntax\n\nCreates an enum map with the same key type as the specified enum map,\ninitially containing the same mappings (if any).\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/EnumMapConst3.java\"\u003e3. EnumMap(Map m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nIt is used to create an enum map initialized from the specified map.\n\n```\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003cth\u003eConstructor\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n\u003c/tr\u003e \n \n\u003ctr\u003e\n\n \u003ctd\u003e 1 . EnumMap(Class keyType) \u003c/td\u003e\n  \u003ctd\u003e \n  Creates an empty enum map with the specified key type.\n  \u003c/td\u003e\n  \n\u003c/tr\u003e \n\n\u003ctr\u003e\n\n \u003ctd\u003e 2 . EnumMap(EnumMap m) \u003c/td\u003e\n  \u003ctd\u003e \n  Creates an enum map with the same key type as the specified enum map,\ninitially containing the same mappings (if any).\n  \u003c/td\u003e\n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n \u003ctd\u003e 3 . EnumMap(Map m) \u003c/td\u003e\n  \u003ctd\u003e \n It is used to create an enum map initialized from the specified map.\n  \u003c/td\u003e\n  \n\u003c/tr\u003e\n\n\n\n\u003c/table\u003e\n\n\u003c/ul\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of EnumMap\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/EnumMapMethods.java\"\u003eMethods of EnumMap\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nNote : \n\nMap.values() returns a Collection , \nHence the return value can be stored in object/variable of Collection.\n\nimport java.util.Collection;\nCollection\u003cType\u003e col_var =Map.values() ;\n\n```\n\u003ch3\u003e\u003cins\u003e\u003ci\u003eNote:\u003c/ins\u003e These methods are already discussed earlier.\u003c/i\u003e \u003c/h3\u003e\n\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eD.ConcurrentMap -Interface\u003c/h1\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.concurrent.ConcurrentMap-\u003e\u003ejava.util.Map:extends \n  \n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic interface ConcurrentMap\u003cK,V\u003e extends Map\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e 1. ConcurrentMap is an interface and it is a member of the Java Collections Framework . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 2. ConcurrentMap is introduced in JDK 1.5 . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 3. ConcurrentMap represents a Map that is capable of handling concurrent access to the Map,without affecting the consistency of entries in a map . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 4. ConcurrentMap interface present in \u003ci\u003e\u003cins\u003ejava.util.concurrent package\u003c/ins\u003e\u003c/i\u003e . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 5. ConcurrentMap extends the Map interface in Java. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 6. ConcurrentMap is known as a synchronized Map. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 7. ConcurrentMap is implemented by ConcurrentSkipListMap and ConcurrentHashMap classes. \u003c/h3\u003e\u003c/li\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Methods of ConcurrentMap Interface\u003c/h2\u003e\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/concurrentMap1.java\"\u003eMethods of ConcurrentMap Interface\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nNote:\n\nFor having all the entries of a Map as a Set:\n\nWe have entrySet() function:\n\nIt can be stored in Set's variable /object by:\n\nEither:\n\nSet\u003cMap.Entry\u003ckeyType, valueType\u003e\u003e set_var = Map.entrySet();\n\nOr:\n\nimport java.util.Map.Entry;\n\nSet\u003cEntry\u003ckeyType, valueType\u003e\u003e set_var = Map.entrySet();\n\n\n```\n\u003ch3\u003e\u003cins\u003e\u003ci\u003eNote:\u003c/ins\u003e These methods are already discussed earlier.\u003c/i\u003e \u003c/h3\u003e\n\n\u003c/ul\u003e\n\n\u003ch2\u003e \u003ci\u003eNew Methods Of ConcurrentMap\u003c/i\u003e\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/concurrentMap2.java\"\u003e1.Application of of() Method\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns an unmodifiable map containing zero mappings.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/concurrentMap3.java\"\u003e2.Application of of(1K,1V,..,nK,nV) Method\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns an unmodifiable map containing 'N'mappings.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/concurrentMap4.java\"\u003e3.Application of of(Map.Entry\u003c? extends K,? extends V\u003e… entries) Method\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns an unmodifiable map containing keys and values,\nextracted from the given entries. \nThe entries themselves are not stored in the map.\n\n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eNew Methods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n\u003ctd\u003e 1.Application of of() Method\u003c/td\u003e\n\u003ctd\u003e Returns an unmodifiable map containing zero mappings. \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 2.Application of of(1K,1V,..,nK,nV) Method\u003c/td\u003e\n\u003ctd\u003e Returns an unmodifiable map containing 'N'mappings. \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 3.Application of of(Map.Entry\u003c? extends K,? extends V\u003e… entries) Method\u003c/td\u003e\n\u003ctd\u003e Returns an unmodifiable map containing keys and values,\nextracted from the given entries. \nThe entries themselves are not stored in the map. \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eE.ConcurrentNavigableMap Interface\u003c/h1\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.concurrent.ConcurrentNavigableMap-\u003e\u003ejava.util.ConcurrentMap:extends\n  java.util.concurrent.ConcurrentNavigableMap-\u003e\u003ejava.util.NavigableMap:extends\n  java.util.concurrent.ConcurrentMap-\u003e\u003ejava.util.Map:extends \n  java.util.NavigableMap-\u003e\u003ejava.util.SortedMap:extends \n  java.util.SortedMap-\u003e\u003ejava.util.Map:extends\n  \n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic interface ConcurrentNavigableMap\u003cK,V\u003e extends ConcurrentMap\u003cK,V\u003e\n                                                 , NavigableMap\u003cK,V\u003e\n                                                 \npublic interface ConcurrentMap\u003cK,V\u003e extends Map\u003cK,V\u003e\npublic interface NavigableMap\u003cK,V\u003e extends SortedMap\u003cK,V\u003e\npublic interface SortedMap\u003cK, V\u003e extends Map\u003cK, V\u003e\n\n\n```\n\n\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e 1. The ConcurrentNavigableMap interface is a member of the Java Collection Framework . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 2. ConcurrentNavigableMap extends from the NavigableMap interface and ConcurrentMap interface . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 3. The ConcurrentNavigableMap provides thread-safe access to map elements along with providing convenient navigation methods . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 4. ConcurrentNavigableMap belongs to \u003ci\u003e\u003cins\u003ejava.util.concurrent package\u003c/ins\u003e\u003c/i\u003e. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 5. ConcurrentNavigableMap is SubInterface of ConcurrentMap interface . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 6. ConcurrentNavigableMap is also Synchronized , like ConcurrentMap interface . \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 7. ConcurrentNavigableMap is implemented by ConcurrentSkipListMap class. \u003c/h3\u003e\u003c/li\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of ConcurrentNavigableMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/concurrentNavigableMap1.java\"\u003eMethods of ConcurrentNavigableMap Interface\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3\u003e\u003cins\u003e\u003ci\u003eNote:\u003c/ins\u003e The methods of  ConcurrentNavigableMap Interface are inherited from SortedMap interface,,Map Interface,NavigableMap Interface and ConcurrentMap Interface.Hence some of them are discussed above.\u003c/i\u003e \u003c/h3\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eConcurrentHashMap \u003c/h1\u003e\n\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.concurrent.ConcurrentHashMap-\u003e\u003ejava.util.AbstractMap:extends \n  java.util.concurrent.ConcurrentHashMap-\u003e\u003ejava.util.concurrent.ConcurrentMap:implements\n  java.util.concurrent.ConcurrentHashMap-\u003e\u003ejava.io.Serializable:implements\n  java.util.concurrent.ConcurrentMap-\u003e\u003ejava.util.Map:extends \n  java.util.AbstractMap-\u003e\u003ejava.util.Map:implements\n  java.util.AbstractMap-\u003e\u003ejava.lang.Object:extends\n\n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class ConcurrentHashMap\u003cK,​V\u003e extends AbstractMap\u003cK,​V\u003e \n                                    implements ConcurrentMap\u003cK,​V\u003e, Serializable\n                               \npublic interface ConcurrentMap\u003cK,V\u003e extends Map\u003cK,V\u003e\n\npublic abstract class AbstractMap\u003cK,V\u003e extends Object implements Map\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e1.The ConcurrentHashMap class is introduced in JDK 1.5 . \u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e2.The ConcurrentHashMap belongs to java.util.concurrent package.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e3.The ConcurrentHashMap class is thread-safe i.e. multiple threads can operate on a single object without any complications i.e \u003ci\u003e \u003cins\u003eSynchronization \u003c/ins\u003e \u003c/i\u003e.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e\u003ci\u003e4.Hashtable is thread safe but give poor performance in multi-threading.Hashmap can solve performance issue by giving parallel access to multiple threads reading hashmap simultaneously but Hashmap is not thread safe, hence ConcurrentHashMap is introduced in JDK 1.5. ConcurrentHashMap is thread safe ,it creates an array  and each index of this array represents a HashMap. And Hashtable and HashMap both uses array and linkedlist as the data structure to store the data. Hence ,we can say, the underlined data structure for ConcurrentHashMap is Hashtable. \u003c/i\u003e\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e5.The default concurrency-level of ConcurrentHashMap is 16.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e6.In ConcurrentHashMap, the Object is divided into a number of segments according to the concurrency level.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e7.In ConcurrentHashMap, at a time any number of threads can perform retrieval operation.\u003c/h3\u003e\u003c/li\u003e \n\n\u003cli\u003e\u003ch3\u003e8.In ConcurrentHashMap, to have a update in the object, the thread must lock the particular segment in which the thread wants to operate. This type of locking mechanism is known as \u003ci\u003e\u003cins\u003eSegment locking or bucket locking\u003c/ins\u003e\u003c/i\u003e. Hence at a time, 16 update operations can be performed by threads as  default concurrency-level of ConcurrentHashMap is 16.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e9.In ConcurrentHashMap, the higher the concurrency level, the more threads can access its buckets at once.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e10.In ConcurrentHashMap class is designed for use in concurrent data access,i.e. accessing data at same time.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e11.Inserting null objects is not possible in ConcurrentHashMap as a key or value.\u003c/h3\u003e\u003c/li\u003e\n\n\u003cli\u003e\u003ch3\u003e12.The ConcurrentHashMap doesn’t throw a ConcurrentModificationException if one thread tries to modify it while another is iterating over it.\u003c/h3\u003e\u003c/li\u003e\n\n\u003ch3\u003e\u003ci\u003e \u003cins\u003eConcurrentHashMap\u003c/ins\u003e \u003c/i\u003e\u003c/h3\u003e\n\n![1_N2ZCdgWnzlrWXczTvfvPFQ](https://user-images.githubusercontent.com/38869235/213485078-2c76b7f8-9ae8-4ffd-a6ab-e119049d64fa.png)\n\n\u003ch3\u003e\u003ci\u003e \u003cins\u003eIn More Details\u003c/ins\u003e \u003c/i\u003e\u003c/h3\u003e\n\n![1_U3oE8gg95rTulEJQGG10GQ](https://user-images.githubusercontent.com/38869235/213486273-c66acf6a-c65c-435e-bec7-abd6ebcef0d5.jpg)\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eNote : \u003c/ins\u003eConcurrent HashMap introduced \u003cins\u003eparallelism threshold\u003c/ins\u003e parameter, which says: \"How many elements are needed for an operation to be executed in parallel, synchronized\". \u003c/i\u003e\u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eSize of Segment  Calculation\u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eConcurrency-Level\u003c/ins\u003e\u003c/i\u003e: It is the number of threads concurrently updating the map.\u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eSegment in ConcurrentHashMap\u003c/ins\u003e\u003c/i\u003e : In ConcurrentHashMap, the Object is divided into a number of segments according to the concurrency level.Each Segment has an Array of HashMap.\u003c/h3\u003e\n \n\u003ch3\u003e\u003ci\u003e[Segment Size = 2^x \u003e=(initialCapacity / concurrencyLevel)]\u003c/i\u003e\u003c/h3\u003e\n\n\n\u003ch3\u003e\nIf concurrency level = 10\n\nSegment Size = 2^x \u003e= 10\n\nif x= 3 then  2^3 \u003e= 10\n\t\t = 8\u003e=10 (Wrong)\n\nThen,\n\nx= 4 then  2^4 \u003e= 10\n           = 16\u003e=10 (Right)\n\nHence Segment Size = 16\n\n\u003c/h3\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConstructors of ConcurrentHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentHashMap.java\"\u003e1. ConcurrentHashMap()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new, empty map with a default initial capacity (16), \nload factor (0.75) and concurrencyLevel (16)\n\nInitial Capacity: Number of elements initially that a map can have. \nif the capacity of this map is 10. It means that it can store 10 entries.\n\nLoadFactor : \nThe load factor is the measure that decides when to increase the capacity of the Map.\nIt’s a threshold, used to control resizing of the Map.\n\nConcurrency-Level: It is the number of threads concurrently updating the map.\nThe implementation performs internal sizing to try to accommodate this many threads.\n\n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentHashMap1.java\"\u003e2. ConcurrentHashMap(initialCapacity)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new, empty map with an initial table size,\naccommodating the specified number of elements,\nwithout the need to dynamically resize.\n\nThat is: Creates a new, \nempty map with the specified initial capacity, \nand with default load factor (0.75) and concurrencyLevel (16)\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentHashMap2.java\"\u003e3. ConcurrentHashMap(initialCapacity,loadFactor)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new empty map ,\nwith an initial table size based on the given number of elements (initialCapacity) \nand initial table density (loadFactor).\n\nThat is: Creates a new empty map ,\nwith the specified initial capacity and \nload factor and with the default concurrencyLevel (16).\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentHashMap3.java\"\u003e4. ConcurrentHashMap(initialCapacity,loadFactor,concurrencyLevel)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new, empty map with an initial table size,\nbased on the given number of elements (initialCapacity), \ntable density (loadFactor), a\nnd number of concurrently updating threads (concurrencyLevel).\n\nThat is: Creates a new, empty map \nwith the specified initial capacity, \nload factor, and concurrency level\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentHashMap4.java\"\u003e5. ConcurrentHashMap(Map m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new map with the same mappings as the given map.\n\n```\n\u003c/ul\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of ConcurrentHashMap \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods1.java\"\u003e1. ConcurrentHashMap -- Methods\u003c/h3\u003e\u003c/li\u003e\n\u003ch3\u003e\u003ci\u003e\u003cins\u003e Note: \u003c/ins\u003eHere methods discussed are inherited from ConcurrentMap,AbstractMap,Map interfaces.\u003c/i\u003e\u003c/h3\u003e\n\n```Syntax\n\nNote: Clone() method is not implemented by ConcurrentHashMap.\nIt belongs to Abstract Map which is not visible to the class.\nIf called then it throws exception : CloneNotSupportedException.\nThere is a reason why Clone() method not implemented in ConcurrentHashMap.\nThe reason is : ConcurrentHashMap is Thread Safe and \ncreating a deep copy of the map would be difficult to implement .\n\n```\n\u003ch3 \u003e\u003ci\u003eHow to implement Clone method? \u003c/i\u003e\u003c/h3\u003e\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethod_Clone.java\"\u003eProcess of Implementation of Clone() method by ConcurrentHashMap\u003c/h3\u003e\u003c/li\u003e\n\n\u003c/ul\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eNew Methods of ConcurrentHashMap \u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods2.java\"\u003e2. forEach​(long parallelismThreshold, BiFunction\u003c? super K,​? super V,​? extends U\u003e transformer, Consumer\u003c? super U\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nPerforms the given action for each non-null transformation of each (key, value).\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nBiFunction: Represents a function that accepts two arguments and produces a result.\n\nTransformer: The transformer transforms the data before sending it to the Consumer.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods7.java\"\u003e3. forEach​(long parallelismThreshold, BiConsumer\u003c? super K,​? super V\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nPerforms the given action for each (key, value).\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nBiFunction: Represents a function that accepts two arguments and produces a result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods8.java\"\u003e4. forEachEntry​(long parallelismThreshold, Consumer\u003c? super Map.Entry\u003cK,​V\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nPerforms the given action for each (key, value).\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods9.java\"\u003e5. forEachEntry​(long parallelismThreshold, Function\u003cMap.Entry\u003cK,​V\u003e,​? extends U\u003e transformer, Consumer\u003c? super U\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nPerforms the given action for each non-null transformation of each entry.\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nFunction: It takes one argument and produces a result.\n\nTransformer: The transformer transforms the data before sending it to the Consumer.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods10.java\"\u003e6. forEachKey​(long parallelismThreshold, Consumer\u003c? super K\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nPerforms the given action for each non-null transformation of each entry.\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods11.java\"\u003e7. forEachKey​(long parallelismThreshold, Function\u003c? super K,​? extends U\u003e transformer, Consumer\u003c? super U\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nPerforms the given action for each non-null transformation of each key.\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nFunction: It takes one argument and produces a result.\n\nTransformer: The transformer transforms the data before sending it to the Consumer.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods12.java\"\u003e8. forEachKey​(long parallelismThreshold, Consumer\u003c? super V\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nPerforms the given action for each value.\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods13.java\"\u003e9. forEachValue​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003etransformer, Consumer\u003c? super U\u003e action) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\nPerforms the given action for each non-null transformation of each value.\n\nThe parallelismThreshold : \nIt sets the number of items at which operations in a map begin to run concurrently.\nIt determines whether bulk operations would be executed sequentially or in parallel.\n\nFunction: It takes one argument and produces a result.\n\nTransformer: The transformer transforms the data before sending it to the Consumer.\n\nConsumer: It represents a functional interface which accepts \na single input argument and produces no result.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods3.java\"\u003e10. keySet​(V mappedValue) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a Set view of the keys in this map, \nusing the given common mapped value for any additions \n(i.e., Collection.add and Collection.addAll(Collection)). \nThis is of course only appropriate if it is acceptable ,\nto use the same value for all additions from this view.\n\nWhich means if a Set's object is set to Map's keyset with \nits Mapped Value and if we continue to add with\nCollection.add () function through set the , added\nvalues will be refered as \"Keys\" of the map , automatically\ngets added to Map as \"Keys\" gets mapped with the given Value.\n\nSuppose we create an empty ConcurrentHashMap:\n\nConcurrentHashMap\u003cString, String\u003e map = new ConcurrentHashMap\u003c\u003e();\n\nSet\u003cString\u003e set = map.keySet(\"1\");\nset.add(\"one\");\nSystem.out.println(\"Map:\" + map);\n\nOutput:\n\nMap:{one=1}\n\nSimilarly,\n\nset = map.keySet(\"2\");\nset.add(\"two\");\n\nSystem.out.println(\"Map:\" + map);\n\nOutput:\n\nMap:{one=1, two=2}\n\n....ETC.\n\nSame for set.addAll() Functionality ,but here ,\n\nDifferent keys will be assigned to Same Values.\n\nSet\u003cString\u003e set2 =new HashSet\u003c\u003e();\nset2.add(\"three\");\nset2.add(\"four\");\nset.addAll(set2);\nSystem.out.println(\"Map:\" + map);\n\nOutput:\n\nMap:{one=1, two=2, three=2, four=2}\n\nAs last mapped value was 2.\n \n \n\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods4.java\"\u003e11. MappingCount \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the number of mappings. \n\nThis method should be used instead of size . The reason is, \na ConcurrentHashMap may contain more mappings,\nthan can be represented as an int. \nThe value returned is an estimate; \nthe actual count may differ ,\nif there are concurrent insertions or removals.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods5.java\"\u003e12. newKeySet() \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new Set backed by a ConcurrentHashMap,\nfrom the given type to Boolean.TRUE.\n\n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods6.java\"\u003e13. newKeySet(int initialCapacity) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nCreates a new Set backed by a ConcurrentHashMap,\nfrom the given type to Boolean.TRUE.\n\n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods14.java\"\u003e14. reduce​(long parallelismThreshold, BiFunction\u003c? super K,​? super V,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation ,\nof all (key, value) pairs using the given reducer ,\nto combine values, or null if none.\n\n:Description of the Code is inside:\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods15.java\"\u003e15. reduceEntries​(long parallelismThreshold, BiFunction\u003cMap.Entry\u003cK,​V\u003e,​Map.Entry\u003cK,​V\u003e,​? extends Map.Entry\u003cK,​V\u003e\u003e reducer) \u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating all entries ,\nusing the given reducer to combine values, or null if none.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods16.java\"\u003e16. reduceEntries​(long parallelismThreshold, Function\u003cMap.Entry\u003cK,​V\u003e,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all entries using the given reducer to combine values, \nor null if none.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods17.java\"\u003e17. reduceEntriesToDouble​(long parallelismThreshold, ToDoubleFunction\u003cMap.Entry\u003cK,​V\u003e\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n\n```Syntax\n\nReturns the result of accumulating the given transformation ,\nof all entries using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods18.java\"\u003e18. reduceEntriesToInt​(long parallelismThreshold, ToIntFunction\u003cMap.Entry\u003cK,​V\u003e\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation ,\nof all entries using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods19.java\"\u003e19. reduceEntriesToLong​(long parallelismThreshold, ToLongFunction\u003cMap.Entry\u003cK,​V\u003e\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all entries using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods20.java\"\u003e20. reduceKeys​(long parallelismThreshold, BiFunction\u003c? super K,​? super K,​? extends K\u003e reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating all keys ,\nusing the given reducer to combine values, \nor null if none.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods21.java\"\u003e21. reduceKeys​(long parallelismThreshold, Function\u003c? super K,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all keys using the given reducer to combine values, \nor null if none.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods22.java\"\u003e22. reduceKeysToDouble​(long parallelismThreshold, ToDoubleFunction\u003c? super K\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\n of all keys using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods23.java\"\u003e23. reduceKeysToInt​(long parallelismThreshold, ToIntFunction\u003c? super K\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all keys using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods24.java\"\u003e24. reduceKeysToLong​(long parallelismThreshold, ToLongFunction\u003c? super K\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all keys using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods25.java\"\u003e25. reduceToDouble​(long parallelismThreshold, ToDoubleBiFunction\u003c? super K,​? super V\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation of all\n(key, value) pairs using the given reducer to combine values,\nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods26.java\"\u003e26.reduceToInt​(long parallelismThreshold, ToIntBiFunction\u003c? super K,​? super V\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation of all (key, value) ,\npairs using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods27.java\"\u003e27.reduceToLong​(long parallelismThreshold, ToLongBiFunction\u003c? super K,​? super V\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation of all \n(key, value) pairs using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods28.java\"\u003e28.reduceValues​(long parallelismThreshold, BiFunction\u003c? super V,​? super V,​? extends V\u003e reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating all values ,\nusing the given reducer to combine values, or null if none.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods29.java\"\u003e29.reduceValues​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation ,\nof all values using the given reducer to combine values, \nor null if none.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods30.java\"\u003e30.reduceValuesToDouble​(long parallelismThreshold, ToDoubleFunction\u003c? super V\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all values using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods31.java\"\u003e31.reduceValuesToInt​(long parallelismThreshold, ToIntFunction\u003c? super V\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation,\nof all values using the given reducer to combine values, \nand the given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods32.java\"\u003e32.reduceValuesToLong​(long parallelismThreshold, ToLongFunction\u003c? super V\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns the result of accumulating the given transformation of all values,\nusing the given reducer to combine values, and \nthe given basis as an identity value.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods33.java\"\u003e33.search​(long parallelismThreshold, BiFunction\u003c? super K,​? super V,​? extends U\u003e searchFunction)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a non-null result from applying the given,\nsearch function on each (key, value), or null if none. \nUpon success, further element processing is suppressed ,\nand the results of any other parallel invocations ,\nof the search function are ignored.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods34.java\"\u003e34.searchEntries​(long parallelismThreshold, Function\u003cMap.Entry\u003cK,​V\u003e,​? extends U\u003e searchFunction)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns a non-null result from applying the given,\nsearch function on each entry, or null if none.\nUpon success, further element processing is suppressed ,\nand the results of any other parallel invocations,\nof the search function are ignored.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods35.java\"\u003e35.searchKeys​(long parallelismThreshold, Function\u003c? super K,​? extends U\u003e searchFunction)\u003c/h3\u003e\u003c/li\u003e\n\n\n```Syntax\n\nReturns a non-null result from applying the given,\nsearch function on each entry, or null if none.\nUpon success, further element processing is suppressed ,\nand the results of any other parallel invocations,\nof the search function are ignored.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods36.java\"\u003e36.searchValues​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003e searchFunction)\u003c/h3\u003e\u003c/li\u003e\n\n\n```Syntax\n\nReturns a non-null result from applying the given,\nsearch function on each entry, or null if none.\nUpon success, further element processing is suppressed ,\nand the results of any other parallel invocations,\nof the search function are ignored.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods37.java\"\u003e37.Enumeration\u003cV\u003e elements()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns an enumeration of the values in this table.\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentHashMapMethods38.java\"\u003e38.Enumeration\u003cK\u003e keys()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nReturns an enumeration of the keys in this table.\n\n```\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eNew Methods\u003c/th\u003e\n    \u003cth\u003eDoes This\u003c/th\u003e\n    \n   \n\u003c/tr\u003e \n\n\u003ctr\u003e\n    \u003ctd\u003e1.forEach​(long parallelismThreshold, BiFunction\u003c? super K,​? super V,​? extends U\u003e transformer, Consumer\u003c? super U\u003e action)\u003c/td\u003e\n    \u003ctd\u003e\n\nA comparison function, which imposes a total ordering on some collection of objects. \nComparators can also be used to control the order of  sorted maps .\nHere,It returns the comparator used to order the keys in this map, \nor null if this map uses the natural ordering of its keys.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e2.forEach​(long parallelismThreshold, BiConsumer\u003c? super K,​? super V\u003e action) \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each (key, value).\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e3.forEachEntry​(long parallelismThreshold, Consumer\u003c? super Map.Entry\u003cK,​V\u003e action) \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each (key, value).\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e4.forEachEntry​(long parallelismThreshold, Function\u003cMap.Entry\u003cK,​V\u003e,​? extends U\u003e transformer, Consumer\u003c? super U\u003e action) \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each non-null transformation of each entry.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e5.forEachKey​(long parallelismThreshold, Consumer\u003c? super K\u003e action) \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each non-null transformation of each entry.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e6.forEachKey​(long parallelismThreshold, Function\u003c? super K,​? extends U\u003e transformer, Consumer\u003c? super U\u003e action) \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each non-null transformation of each key.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e7.forEachKey​(long parallelismThreshold, Consumer\u003c? super V\u003e action) \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e8. forEachValue​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003etransformer, Consumer\u003c? super U\u003e action)  \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each non-null transformation of each value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e8. forEachValue​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003etransformer, Consumer\u003c? super U\u003e action)  \u003c/td\u003e\n    \u003ctd\u003e\n\nPerforms the given action for each non-null transformation of each value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e9. keySet​(V mappedValue)  \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a Set view of the keys in this map, \nusing the given common mapped value for any additions \n(i.e., Collection.add and Collection.addAll(Collection)). \nThis is of course only appropriate if it is acceptable ,\nto use the same value for all additions from this view.\n\nWhich means if a Set's object is set to Map's keyset with \nits Mapped Value and if we continue to add with\nCollection.add () function through set the , added\nvalues will be refered as \"Keys\" of the map , automatically\ngets added to Map as \"Keys\" gets mapped with the given Value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e10. MappingCount  \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the number of mappings. This method should be used instead of size . The reason is, a ConcurrentHashMap may contain more mappings,\nthan can be represented as an int. The value returned is an estimate; the actual count may differ ,if there are concurrent insertions or removals.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e11. newKeySet()  \u003c/td\u003e\n    \u003ctd\u003e\n\nCreates a new Set backed by a ConcurrentHashMap,from the given type to Boolean.TRUE.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e12. newKeySet(int initialCapacity)   \u003c/td\u003e\n    \u003ctd\u003e\n\nCreates a new Set backed by a ConcurrentHashMap,from the given type to Boolean.TRUE.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e13. reduce​(long parallelismThreshold, BiFunction\u003c? super K,​? super V,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer)   \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation ,of all (key, value) pairs using the given reducer ,to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e14. reduceEntries​(long parallelismThreshold, BiFunction\u003cMap.Entry\u003cK,​V\u003e,​Map.Entry\u003cK,​V\u003e,​? extends Map.Entry\u003cK,​V\u003e\u003e reducer) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating all entries ,using the given reducer to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e15. reduceEntries​(long parallelismThreshold, Function\u003cMap.Entry\u003cK,​V\u003e,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all entries using the given reducer to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e16. reduceEntriesToDouble​(long parallelismThreshold, ToDoubleFunction\u003cMap.Entry\u003cK,​V\u003e\u003e transformer, double basis, DoubleBinaryOperator reducer) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation ,of all entries using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e17. reduceEntriesToInt​(long parallelismThreshold, ToIntFunction\u003cMap.Entry\u003cK,​V\u003e\u003e transformer, int basis, IntBinaryOperator reducer) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation ,of all entries using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e18. reduceEntriesToLong​(long parallelismThreshold, ToLongFunction\u003cMap.Entry\u003cK,​V\u003e\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all entries using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e19.reduceKeys​(long parallelismThreshold, BiFunction\u003c? super K,​? super K,​? extends K\u003e reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating all keys ,using the given reducer to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e20.reduceKeys​(long parallelismThreshold, Function\u003c? super K,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all keys using the given reducer to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e21.  reduceKeysToDouble​(long parallelismThreshold, ToDoubleFunction\u003c? super K\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all keys using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e22.  reduceKeysToInt​(long parallelismThreshold, ToIntFunction\u003c? super K\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all keys using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e23.reduceKeysToLong​(long parallelismThreshold, ToLongFunction\u003c? super K\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all keys using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e24.reduceToDouble​(long parallelismThreshold, ToDoubleBiFunction\u003c? super K,​? super V\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation of all (key, value) pairs using the given reducer to combine values,and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e25. reduceToInt​(long parallelismThreshold, ToIntBiFunction\u003c? super K,​? super V\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation of all (key, value) ,pairs using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e26. reduceToLong​(long parallelismThreshold, ToLongBiFunction\u003c? super K,​? super V\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation of all (key, value) pairs using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e27. reduceValues​(long parallelismThreshold, BiFunction\u003c? super V,​? super V,​? extends V\u003e reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating all values ,using the given reducer to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e28. reduceValues​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003e transformer, BiFunction\u003c? super U,​? super U,​? extends U\u003e reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation ,of all values using the given reducer to combine values, or null if none.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e29. reduceValuesToDouble​(long parallelismThreshold, ToDoubleFunction\u003c? super V\u003e transformer, double basis, DoubleBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all values using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e30. reduceValuesToInt​(long parallelismThreshold, ToIntFunction\u003c? super V\u003e transformer, int basis, IntBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation,of all values using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e31. reduceValuesToLong​(long parallelismThreshold, ToLongFunction\u003c? super V\u003e transformer, long basis, LongBinaryOperator reducer)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns the result of accumulating the given transformation of all values,using the given reducer to combine values, and the given basis as an identity value.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e32.search​(long parallelismThreshold, BiFunction\u003c? super K,​? super V,​? extends U\u003e searchFunction)\u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a non-null result from applying the given,search function on each (key, value), or null if none. Upon success, further element processing is suppressed ,and the results of any other parallel invocations ,of the search function are ignored.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e33. searchEntries​(long parallelismThreshold, Function\u003cMap.Entry\u003cK,​V\u003e,​? extends U\u003e searchFunction) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a non-null result from applying the given,search function on each entry, or null if none.Upon success, further element processing is suppressed ,and the results of any other parallel invocations,of the search function are ignored.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n    \u003ctd\u003e34. searchKeys​(long parallelismThreshold, Function\u003c? super K,​? extends U\u003e searchFunction) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a non-null result from applying the given,search function on each entry, or null if none.Upon success, further element processing is suppressed ,and the results of any other parallel invocations,of the search function are ignored.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e35. searchValues​(long parallelismThreshold, Function\u003c? super V,​? extends U\u003e searchFunction) \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns a non-null result from applying the given,search function on each entry, or null if none.Upon success, further element processing is suppressed ,and the results of any other parallel invocations,of the search function are ignored.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e36. Enumeration\u003cV\u003e elements() \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns an enumeration of the values in this table.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n    \u003ctd\u003e37. Enumeration\u003cK\u003e keys() \u003c/td\u003e\n    \u003ctd\u003e\n\nReturns an enumeration of the keys in this table.\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003c/ul\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConcurrentHashMap.KeySetView - Inner Class of ConcurrentHashMap \u003c/h2\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.concurrent.ConcurrentHashMap-\u003e\u003ejava.util.ConcurrentHashMap.KeySetView:InnerClass \n  java.util.ConcurrentHashMap.KeySetView-\u003e\u003ejava.util.concurrent.ConcurrentHashMap.CollectionView:extends\n  java.util.ConcurrentHashMap.KeySetView-\u003e\u003ejava.util.Set:implements\n  java.util.ConcurrentHashMap.KeySetView-\u003e\u003ejava.io.Serializable:implements\n\n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class ConcurrentHashMap\u003cK,V\u003e extends AbstractMap\u003cK,V\u003e\n    implements ConcurrentMap\u003cK,V\u003e, Serializable {\n\n ......\n\n public static final class KeySetView\u003cK,V\u003e extends CollectionView\u003cK,V,K\u003e\n        implements Set\u003cK\u003e, java.io.Serializable\n\n ....\n\n}\n\n```\n\n\u003c/h3\u003e\n\n\u003cul\u003e\n\n\u003ch3\u003e\u003ci\u003e \u003cli\u003e1. CollectionView class is an abstract class of ConcurrentHashMap class which is not viable or be imported to any file . Syntax as follows: \u003c/li\u003e\u003c/i\u003e\u003ch3\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\nabstract static sealed class CollectionView\u003cK,V,E\u003e\n        implements Collection\u003cE\u003e, java.io.Serializable \n\tpermits EntrySetView, KeySetView, ValuesView\n\n```\n\u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cli\u003e 2.  More Over EntrySetView, KeySetView and ValuesView are \"Static Final Classes\" of \"ConcurrentHashMap\" class and are not viable or be imported to any file.  Syntax as follows:\u003c/li\u003e\u003c/i\u003e\u003ch3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eEntrySetView Class\u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\nstatic final class EntrySetView\u003cK,V\u003e extends \n\tCollectionView\u003cK,V,Map.Entry\u003cK,V\u003e\u003e\n        implements Set\u003cMap.Entry\u003cK,V\u003e\u003e, java.io.Serializable\n\n```\n\u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003e KeySetView Class\u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic static final class KeySetView\u003cK,V\u003e extends CollectionView\u003cK,V,K\u003e\n        implements Set\u003cK\u003e, java.io.Serializable\n\n```\n\u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003e  ValuesView Class\u003c/ins\u003e\u003c/i\u003e\u003c/h3\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\nstatic final class ValuesView\u003cK,V\u003e extends CollectionView\u003cK,V,V\u003e\n        implements Collection\u003cV\u003e, java.io.Serializable\n\n```\n\u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cli\u003e 3.  CollectionView class, EntrySetView class, KeySetView class and ValuesView class cannot be implemented directly but can be implemented through KeySetView as KeySetView , the inner class of ConcurrentHashMap class inherit those classes along with Set and Serializable interface.  \u003c/li\u003e\u003c/i\u003e\u003ch3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cli\u003e 4.  The main motive of KeySetView , the inner class of ConcurrentHashMap to store the Keys of the given Map as a Set in a Variable or object created by KeySet class or ConcurrentHashMap.KeySet class.  \u003c/li\u003e\u003c/i\u003e\u003ch3\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Implementation of ConcurrentHashMap.KeySetView class \u003c/h2\u003e\n\u003cul\u003e\n\n\u003ch3\u003e \u003cli\u003e\u003ca href=\"https://github.com/AvinandanBose/Java-Collections-Map/blob/main/ConcurrentHashMapKSV1.java\"\u003e 1. ConcurrentHashMap.KeySetView-Eg(1) \u003c/li\u003e \u003c/h3\u003e\n\u003ch3\u003e\u003cli\u003e \u003ca href=\"https://github.com/AvinandanBose/Java-Collections-Map/blob/main/ConcurrentHashMapKSV2.java\"\u003e 2. ConcurrentHashMap.KeySetView-Eg(2) \u003c/li\u003e \u003c/h3\u003e\n\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eConcurrentSkipListMap\u003c/h1\u003e\n\u003cul\u003e\n\n```mermaid\n\nsequenceDiagram\n\n  java.util.concurrent.ConcurrentSkipListMap-\u003e\u003ejava.lang.Cloneable:implements\n  java.util.concurrent.ConcurrentSkipListMap-\u003e\u003ejava.io.Serializable:implements\n  java.util.concurrent.ConcurrentSkipListMap-\u003e\u003ejava.util.concurrent.ConcurrentNavigableMap:implements\n  java.util.concurrent.ConcurrentSkipListMap-\u003e\u003ejava.util.AbstractMap:extends\n  java.util.concurrent.ConcurrentNavigableMap-\u003e\u003ejava.util.ConcurrentMap:extends\n  java.util.concurrent.ConcurrentNavigableMap-\u003e\u003ejava.util.NavigableMap:extends\n  java.util.concurrent.ConcurrentMap-\u003e\u003ejava.util.Map:extends \n  java.util.NavigableMap-\u003e\u003ejava.util.SortedMap:extends \n  java.util.SortedMap-\u003e\u003ejava.util.Map:extends\n  java.util.AbstractMap-\u003e\u003ejava.util.Map:implements\n  java.util.AbstractMap-\u003e\u003ejava.lang.Object:extends\n\n```\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class ConcurrentSkipListMap\u003cK,​V\u003e extends AbstractMap\u003cK,​V\u003e \n\t\timplements ConcurrentNavigableMap\u003cK,​V\u003e, Cloneable, Serializable\n\t\t\npublic abstract class AbstractMap\u003cK,V\u003e extends Object implements Map\u003cK,V\u003e\n\npublic interface ConcurrentNavigableMap\u003cK,V\u003e extends ConcurrentMap\u003cK,V\u003e\n                                                 , NavigableMap\u003cK,V\u003e\n                                                 \npublic interface ConcurrentMap\u003cK,V\u003e extends Map\u003cK,V\u003e\npublic interface NavigableMap\u003cK,V\u003e extends SortedMap\u003cK,V\u003e\npublic interface SortedMap\u003cK, V\u003e extends Map\u003cK, V\u003e\n\n```\n\n\n\u003c/h3\u003e\n\u003cul\u003e\n\n\u003cli\u003e \u003ch3\u003e 1.The ConcurrentSkipListMap class is a member of the Java Collections Framework.\u003c/h3\u003e\u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e 2.The ConcurrentSkipListMap was introduced in JDK 1.6.\u003c/h3\u003e\u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e 3.The ConcurrentSkipListMap belongs to java.util.concurrent package.\u003c/h3\u003e\u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e 4.The ConcurrentSkipListMap is a scalable implementation of ConcurrentNavigableMap.\u003c/h3\u003e\u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e 5.All the elements of ConcurrentSkipListMap sorted based on natural ordering or by the Comparator passed during it’s construction time.\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 6.This class uses a concurrent variation of SkipList data structure providing log(n) time cost for insertion, removal, update, and access operations. \u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e \u003ch3\u003e 7.These operations are safe for executing concurrently by multiple threads. (ConcurrentSkipListMap is thread-safe.) \u003c/h3\u003e\u003c/li\u003e\n\n\u003c/ul\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eConstructors of ConcurrentSkipListMap\u003c/h2\u003e\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap.java\"\u003e1.ConcurrentSkipListMap()\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new, empty map, sorted according to the natural ordering of the keys.\n\n```\n\n\u003cli\u003e\u003ch3\u003e 2.ConcurrentSkipListMap​(Comparator\u003c? super K\u003e comparator)\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap1.java\"\u003e2.a.ConcurrentSkipListMap​(Comparator\u003c? super K\u003e comparator)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new, empty map, sorted according to the specified comparator.\n\nNote: \n\n1. ConcurrentSkipListMap\u003cKey, Value\u003e map = \nnew ConcurrentSkipListMap\u003c\u003e((a, b) -\u003e b.compareTo(a))\n\n2. Comparator\u003c? super Key\u003e comparator = map.comparator();\n\nConcurrentSkipListMap\u003cKey, Value\u003e map = \nnew ConcurrentSkipListMap\u003c\u003e(comparator)\n\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap2.java\"\u003e2.b.ConcurrentSkipListMap​(Comparator\u003c? super K\u003e comparator)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new, empty map, sorted according to the specified comparator.\n\nHere Class implements Comparator interface for comparison.\n\nGenerally negative comparison : ReverseOrder\n\nGenerally positive comparison : AscendingOrder/NaturalOrder\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap5.java\"\u003e2.c.ConcurrentSkipListMap​(Comparator\u003c? super K\u003e comparator)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new, empty map, sorted according to the specified comparator.\n\nHere Comparator object is passed inside Constructor.\n\nGenerally negative comparison : ReverseOrder\n\nGenerally positive comparison : AscendingOrder/NaturalOrder\n\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap6.java\"\u003e2.d.ConcurrentSkipListMap​(Comparator\u003c? super K\u003e comparator)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new, empty map, sorted according to the specified comparator.\n\nHere Direct Comparator Class is called inside Constructor.\n\nComparator.reverseOrder(): Gives Reverse Order of Values\nComparator.naturalOrder(): Gives Natural Order of Values\n\nAny negative comparison : ReverseOrder\n\nAny positive comparison : AscendingOrder/NaturalOrder\n\n```\n\n\u003c/ul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap3.java\"\u003e3.ConcurrentSkipListMap​(Map\u003c? extends K,​? extends V\u003e m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new map containing the same mappings as the given map, \nsorted according to the natural ordering of the keys.​\n\n\n```\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/constructConcurrentSkipListMap4.java\"\u003e4.ConcurrentSkipListMap​(SortedMap\u003cK,​? extends V\u003e m)\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n\nConstructs a new map containing the same mappings and \nusing the same ordering as the specified sorted map.\n\n\n```\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003eMethods of ConcurrentSkipListMap \u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/ConcurrentSkipListMapMethods.java\"\u003eMethods of ConcurrentSkipListMap\u003c/h3\u003e\u003c/li\u003e\n\u003ch3\u003e\u003ci\u003e\u003cins\u003eNote:\u003c/ins\u003e These methods are already discussed above. \u003c/i\u003e\u003c/h3\u003e \n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003ch1\u003e \u003c/h1\u003e\n\u003ch1\u003eF. Map.Entry Interface (Sub Interface of Map Interface) and Map.of() \u003c/h1\u003e\n\u003cul\u003e\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Map.Entry Interface (Sub Interface of Map Interface)  \u003c/h2\u003e\n\n\u003cli\u003e \u003ch3\u003e1.A map contains values on the basis of key, i.e. key and value pair.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e2.Each key and value pair is known as an Entry.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e3.Entry is the subinterface of Map.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e4.So we can access it by Map.Entry name.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e5.Map.Entry interface in Java provides certain methods to access the entry in the Map.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e6.Map.Entry helps us to gain access to the entries of the Map.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e7.By gaining access to the entry of the Map we can easily manipulate them.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e8.Map.Entry is a generic and is defined in the java.util package.\u003c/h3\u003e \u003c/li\u003e\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic static interface Map.Entry\u003cK,V\u003e\n\n```\n\n\u003c/h3\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Implementation of Map.Entry \u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapEntry_HashMap.java\"\u003e1.Implementation of Map.Entry in HashMap\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapEntry_LinkedHashMap.java\"\u003e2.Implementation of Map.Entry in LinkedHashMap\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapEntry_WeakHashMap.java\"\u003e3.Implementation of Map.Entry in WeakHashMap\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapEntry_TreeMap.java\"\u003e4.Implementation of Map.Entry in TreeMap\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapEntry_ConcurrentHashMap.java\"\u003e4.Implementation of Map.Entry in ConcurrentHashMap\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapEntry_ConcurrentSkipListMap.java\"\u003e5.Implementation of Map.Entry in ConcurrentSkipListMap\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003e \u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Map.of(K,V) and Map.ofEntries(Map.entry(K,V))  \u003c/h2\u003e\n\n\u003cli\u003e \u003ch3\u003e1.The Map.of and Map.ofEntries are static factory methods that return unmodifiable Map containing specified mapping.\u003c/h3\u003e \u003c/li\u003e\n\n\u003cli\u003e \u003ch3\u003e2.They are  introduced in Java 9.\u003c/h3\u003e \u003c/li\u003e\n\n\u003ch2\u003e\u003c/h2\u003e\n\u003ch2 align=\"Center\"\u003e Implementation of Map.Entry \u003c/h2\u003e\n\n\u003cul\u003e\n\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapOf.java\"\u003e1.Implementation of MapOf functionality\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e \u003ca href=\"https://github.com/AvinandanBose/JavaUtilMap/blob/main/MapOfEntries.java\"\u003e2.Implementation of MapOfEntries functionality\u003c/h3\u003e\u003c/li\u003e\n\n\u003c/ul\u003e\n\n\u003c/ul\u003e\n\n\u003ch1\u003e \u003c/h1\u003e\n\u003ch1 align=\"Center\"\u003eHashTable Class\u003c/h1\u003e\n\u003cul\u003e\n\n```mermaid\n\nsequenceDiagram\n\n   java.util.HashTable-\u003e\u003ejava.util.Dictionary:extends \n   java.util.HashTable-\u003e\u003ejava.util.Map:implements\n   java.util.HashTable-\u003e\u003ejava.io.Serializable:implements\n  java.util.HashTable-\u003e\u003ejava.lang.Cloneable:implements\n  \n\n\n```\n\n\u003ch3 align=\"Center\"\u003e\n\n```Syntax\n\npublic class Hashtable\u003cK,V\u003e extends Dictionary\u003cK,V\u003e \n\t\timplements Map\u003cK,V\u003e, Cloneable, Serializable\n\n```\n\n\u003ch3\u003e\n\n\u003ch3\u003e \u003ci\u003e\u003cins\u003eNote :\u003c/ins\u003e Details of \u003cins\u003eHashTable\u003c/ins\u003e class is explained 👉 \u003ca href=\"https://github.com/AvinandanBose/Java-Collections-HashTable\"\u003eLink Here \u003c/a\u003e\u003c/h3\u003e\n\n\u003c/ul\u003e\n\n\u003ch1\u003e👉\u003ca href= \"https://github.com/AvinandanBose/JavaGeneric\"\u003eImplementation of Map in Java Generics\u003c/h1\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinandanbose%2Fjava-collections-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinandanbose%2Fjava-collections-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinandanbose%2Fjava-collections-map/lists"}