We break down why
Map cannot be iterated “by indices”, how to work with the
keys/
values/
entries views, what
Map.Entry is and how it differs from
Pair. We learn how to choose an iteration style (keys, values, or pairs), use destructuring
(
k
,
v
) in a loop, and reinforce everything with a practical example of an expense-by-category report, while also looking at common mistakes.