Java Set

Java 10

Java CopyOnWriteArraySet class

CopyOnWriteArraySet is a thread-safe Set in Java. It ensures safe concurrent access by creating a new copy of the internal array for each modification.

Java TreeSet class

Java TreeSet class extends AbstractSet and implements NavigableSet interface. It is very similar to HashSet class, except it stores the element in sorted order.

Java LinkedHashSet class

Java LinkedHashSet class extends HashSet and implements Set interface. It is very very similar to HashSet class, except if offers the predictable iteration order.

Java HashSet class

Java HashSet class implements the Set interface, backed by a hash table(actually a HashMap instance). If does not offer any guarantees as to the iteration order, and allows null element.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.