map
13 tutorials tagged “map”.
- HashMap Internal WorkingHow HashMap works inside: hashCode, the bucket array, index calculation, collisions, linked lists and trees, load factor, resizing, and the get and put steps.
- Difference Between HashMap and HashtableHashMap vs Hashtable in Java: synchronization, null handling, performance, iteration, legacy status and the modern ConcurrentHashMap alternative.
- EnumMap in JavaEnumMap is a fast, compact Map whose keys are values of one enum type. Learn its features, constructors and methods, with examples.
- HashMap in JavaHashMap stores key-value pairs in a hash table for fast lookup. Learn its features, constructors, methods, ordering, and how to use your own classes as keys.
- Hashtable in JavaHashtable is a legacy, synchronized hash table map that allows no null keys or values. Learn its methods, how it differs, and what replaced it.
- LinkedHashMap in JavaLinkedHashMap is a HashMap that remembers insertion or access order. Learn its features, access-order mode, and how to build an LRU cache with it.
- TreeMap in JavaTreeMap stores key-value pairs sorted by key using a red-black tree. Learn its constructors, methods, custom key order, and how it differs from HashMap.
- Map.Entry and Iterating Over MapsMap.Entry represents one key-value pair. Learn every way to loop over a map: entrySet, keySet, values, forEach and iterators, plus removing while looping.
- Map Interface in JavaThe Map interface stores key-value pairs with unique keys. Learn its features, implementations, methods and examples of put, get, remove and containsKey.
- Map Methods in JavaJava's modern Map methods: getOrDefault, putIfAbsent, computeIfAbsent, computeIfPresent, compute, merge, replaceAll and more, with a word-frequency counter.