0

Why, within the collections hierarchy, does map not implement the collections interface like set, list and queue do?

e.g in this diagram:

Collections hierarchy diagram

  • This got answered already couple of times. I.e. here: http://stackoverflow.com/questions/2651819/why-doesnt-java-map-extends-collection – stolzem May 11 '14 at 21:39

1 Answers1

0

Because unlike Lists and Sets, they're built on key-value pairs. The collection interface only has methods to interact with a unique object at a time, not a key-value pair.

Alexandre FILLATRE
  • 1,305
  • 11
  • 20