# Assertion

say it: **“uh-SER-shun”** **/əˈsɜːrʃən/**

A development-time check that reports when an expected condition is false.

## What is **Assertion** in Java?

**Assertion** — A development-time check that reports when an expected condition is false.

```java
class Inventory {
    void checkQuantity(int quantity) {
        assert quantity >= 0 : "quantity cannot be negative";
    }
}
```

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

Updated: November 17, 2026

## In other subjects

- [Assertion in Unit Testing](https://www.ask-codey.com/glossary/assertion-unit-testing)

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