A unified architecture for storing, managing, and manipulating groups of objects.
Includes interfaces, implementations (classes), and utility methods.

Core Interfaces

InterfaceDescription
CollectionRoot interface (for lists, sets, queues)
ListOrdered collection with duplicates allowed
SetUnordered, no duplicates
QueueFIFO structure (some support LIFO)
MapKey-value pairs (not part of Collection)

Map is a part of the framework, but not a subtype of Collection

Collection Hierarchy (Simplified)

          Iterable
              β”‚
         Collection
        /    |      \
     List   Set    Queue
 
    Map (separate branch)

Key Features

  • Built-in data structures.
  • Ready-to-use implementations.
  • Generic support (e.g. List).
  • Algorithms in Collections class.
  • Consistent API (add, remove, size, contains…).

Example

List<String> list = new ArrayList<>();
list.add("Hello");
 
Set<Integer> set = new HashSet<>();
set.add(10);
 
Map<String, Integer> map = new HashMap<>();
map.put("A", 1);

Common Implementations

TypeClasses
ListArrayList, LinkedList, Vector
SetHashSet, LinkedHashSet, TreeSet
QueuePriorityQueue, ArrayQueue
MapHashMap, LinkedHashMap, TreeMap, Hashtable

Tip

Be ready to explain:

  • why use List vs Set vs Map,
  • the core difference between Collection and Collections,
  • why Map is not a subtype of Collection.

Parent: _Collections