Last Updated: June 6, 2026
A Map<K, V> stores key-value pairs where every key is unique and points to one value. Use it whenever your code has to look something up by an identifier: a product by its productId, a customer by their email, an order by its orderId. This lesson covers what Map is (and why it isn't a Collection), the core methods every Java developer should know, the handful of default methods that make Map code much shorter, how to iterate a map cleanly, the key equality rule that decides whether a lookup succeeds, and a one-line tour of the four main implementations.