# break

say it: **“BRAYK”** **/ˈbreɪk/**

A statement that immediately exits the nearest loop or switch.

## What does **break** do in Java?

**break** — A statement that immediately exits the nearest loop or switch.

```java
class NumberFinder {
    int firstOddNumber(int[] numbers) {
        for (int number : numbers) {
            if (number % 2 == 0) {
                continue;
            }

            return number;
        }

        return -1;
    }
}
```

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

Updated: November 17, 2026

## In other subjects

- [break in C#](https://www.ask-codey.com/glossary/break-c-sharp)
- [break in JavaScript](https://www.ask-codey.com/glossary/break-javascript)
- [break in PowerShell](https://www.ask-codey.com/glossary/break-powershell)
- [break in Python](https://www.ask-codey.com/glossary/break)
- [break in Unix](https://www.ask-codey.com/glossary/break-unix)

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