What is a set in Java?
Answer:
The java.util.Set
interface is a subtype of the java.util.Collection
interface.
It represents set of objects, meaning each element can only exists once in a Set.
java.util
Interface Set<E>
Type Parameters:
E - the type of elements maintained by this set
All Superinterfaces:
Collection<E>, Iterable<E>
All Known Subinterfaces:
NavigableSet<E>, SortedSet<E>
All Known Implementing Classes:
AbstractSet, ConcurrentSkipListSet, CopyOnWriteArraySet, EnumSet, HashSet,
JobStateReasons, LinkedHashSet, TreeSet