🎯 1. What is the Map Interface? (Super Simple)

Map stores data as key → value pairs.

Key rules:

Keys are unique

Values can repeat

✔ No indexes

✔ Access via keys

Example:

Map<Integer, String> map = new HashMap<>();
map.put(1, "Ava");

2. Why Map Exists?

Because many problems are naturally lookup-based:

✔ UserId → User

✔ ProductId → Price

✔ Username → Password

✔ Country → Capital

Maps give fast search by key.


🧱 3. Map Interface Hierarchy