Set Interface

  • Set is a child interface of Collection Interface
  • Set Interface and HashSet class came into picture in java 1.2 version and LinkedHashSet class was added into collections in java 1.4 version

Features of Set, When to go for Set?

  • Duplicates are not allowed.
  • Insertion order is not preserved.
public interface Set<E> extends Collection<E> { }

Implementation classes of Set interface are :

  • HashSet
  • LinkedHashSet extends HashSet

Leave a Comment