Question: what is the difference between a map and a set?
Answer: A Set is an interface in Collection hierarchy that cannot contain duplicate elements whereas a Map is an interface that maps unique keys to values. This is the main difference between Set and Map.