This post helps you understand how the Set interfaces and classes are designed in the Java Collections framework.

You know, in Set API:

    • Set<E>is the base interface for all kinds of set. This interface extends all methods from the Collection<E> interface and does not define any new methods.
    • Sub interfaces: SortedSet<E> and NavigableSet<E>.
    • Abstract subclasses: AbstractSet<E> and EnumSet<E extends enum<E>>.
    • Concrete implementation classes: HashSet<E>,LinkedHashSet<E>,TreeSet<E>, ConcurrentSkipListSet<E> and CopyOnWriteArraySet<E> (these two last classes are under java.util.concurrent package).
    • The JobStateReasons class extends HashSet<E> but it is not a member of Java Collections Framework.

The following class diagram outlines the Set API in Java Collections Framework:

Set API class diagram

 

Related Java Set Tutorials:

 

Other Java Collections Tutorials:


About the Author:

is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.



Add comment