pair vs map code example Example: list vs map List is collection of elements whereas map is collection of key-value pairs.