Loading

Set Interface in Collection Framework

Block Diagram of Set Interface

Indications/ Symbols:

  • <<       >>      : Interface
  • <          >       : Class
  • ---------->       : Implements

Key points:

  • Set is a type of collection that stores only unique elements. It doesn't allow duplicate elements.
  • It doesn't have Index i.e. elements stored randomly.
  • The Set doesn't maintain the order of insertion.
  • The elements of the Set can be accessed either by using enhanced for loop or Iterator.
  • The implementation classes of a Set interface are
  1. HashSet
  2. LinkedHashSet
  3. TreeSet