# Recursion

A technique in which a method calls itself with a smaller version of the problem.

## What is **Recursion** in Java?

**Recursion** — A technique in which a method calls itself with a smaller version of the problem.

```java
class Countdown {
    int count(int number) {
        if (number == 0) {
            return 0;
        }

        return 1 + count(number - 1);
    }
}
```

Level: Apprentice · [More Java terms at this level](https://www.ask-codey.com/glossary/subjects/java/apprentice)

Updated: September 27, 2026

## In other subjects

- [Recursion in C#](https://www.ask-codey.com/glossary/recursion-c-sharp)
- [Recursion in JavaScript](https://www.ask-codey.com/glossary/recursion-javascript)

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