# Set

say it: **“SET”** **/sɛt/**

A collection that does not keep duplicate elements.

## What is **Set** in Java?

**Set** — A collection that does not keep duplicate elements.

```java
import java.util.HashSet;
import java.util.Set;

class TagCollection {
    Set<String> tags = new HashSet<>();
}
```

Level: Freelancer · [More Java terms at this level](https://www.ask-codey.com/glossary?category=java&level=4)

Updated: November 17, 2026

## In other subjects

- [Set in Data Structures](https://www.ask-codey.com/glossary/set-data-structures)
- [Set in JavaScript](https://www.ask-codey.com/glossary/set-javascript)
- [Set in Python](https://www.ask-codey.com/glossary/set)

Source: https://www.ask-codey.com/glossary/set-java
