Q25: What is the high-level architecture of the Java Collections Framework?

Rooted at java.util.Collection (for single elements) and java.util.Map (for key-value pairs):

  • Collection:
    • List: Ordered, allows duplicates (ArrayList, LinkedList, Vector).
    • Set: Unordered, unique elements (HashSet, LinkedHashSet, TreeSet).
    • Queue / Deque: Element processing order (PriorityQueue, ArrayDeque).
  • Map (Separate Hierarchy): Key-value mapping (HashMap, LinkedHashMap, TreeMap, ConcurrentHashMap).
Key Takeaways
  • Map does NOT extend Collection.
  • List maintains insertion order; Set enforces element uniqueness.
Knowledge Check

Which core collection interface does java.util.Map extend?