22 Java Collections: Set

 

After reading this lesson, you will be able to:

  • Understand when to use the Set collection
  • Create sets using the HashSet, LinkedHashSet, and TreeSet classes
  • Apply methods available for the Set collection in a Java program

This lesson introduces the types of Set collections Java. It includes the benefits of using and the difference between the types of Sets.  A Set is an object that represents another group of objects that does not allow for any duplicates.

22.1   Sets in Java

22.2   Understand when to use the Set collection

22.3   HashSet, LinkedHashSet, and TreeSet

22.3.1   HashSet

22.3.2   LinkedHashSet

22.3.3   TreeSet

22.4   Common Collection Interface Methods

22.5   Summary