# Optional

say it: **“OP-shuh-nul”** **/ˈɒpʃənəl/**

A container that explicitly represents either one non-null value or no value.

## What is **Optional** in Java?

**Optional** — A container that explicitly represents either one non-null value or no value.

```java
import java.util.Optional;

class Profile {
    Optional<String> nickname = Optional.of("Ace");
}
```

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

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/optional
